I have installed pytorch 0.4.1 by the followint command line
conda install pytorch=0.4.1 cuda90 -c pytorch
but encounter the following error
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1535493744281/work/aten/src/THC/THCGeneral.cpp line=663 error=11 : invalid argument
Exception ignored in: <function _DataLoaderIter.__del__ at 0x7f4373417290>
Traceback (most recent call last):
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 399, in __del__
self._shutdown_workers()
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 378, in _shutdown_workers
self.worker_result_queue.get()
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/multiprocessing/queues.py", line 354, in get
return _ForkingPickler.loads(res)
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/site-packages/torch/multiprocessing/reductions.py", line 151, in rebuild_storage_fd
fd = df.detach()
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/multiprocessing/resource_sharer.py", line 57, in detach
with _resource_sharer.get_connection(self._id) as conn:
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/multiprocessing/resource_sharer.py", line 87, in get_connection
c = Client(address, authkey=process.current_process().authkey)
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/multiprocessing/connection.py", line 499, in Client
deliver_challenge(c, authkey)
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/multiprocessing/connection.py", line 729, in deliver_challenge
response = connection.recv_bytes(256) # reject large message
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/multiprocessing/connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/multiprocessing/connection.py", line 407, in _recv_bytes
buf = self._recv(4)
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
ConnectionResetError: [Errno 104] Connection reset by peer
Traceback (most recent call last):
File "TestArtistic.py", line 87, in <module>
sF = vgg(styleV)
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/home/yuxijin/LinearStyleTransfer/libs/models.py", line 43, in forward
out = self.conv1(x)
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/home/yuxijin/anaconda3/envs/LinearStyle/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: cuda runtime error (11) : invalid argument at /opt/conda/conda-bld/pytorch_1535493744281/work/aten/src/THC/THCGeneral.cpp:663
I searched for solutions and solved the error by reinstall pytorch 0.4.1 with the following command line
conda install pytorch=0.4.1 cuda92 -c pytorch
The solution is inspired by the following blog:
https://blog.csdn.net/qq_40723205/article/details/100137810
The installation of pytorch can refer to
INSTALLING PREVIOUS VERSIONS OF PYTORCH
You can check the version of torch and torchvision and install torchvision by the guidance of the following two blogs if necessary.
torchvision 0.7.0
install of torchvision