RuntimeError: cuda runtime error (11) : invalid argument at /opt.../THC/THCGeneral.cpp:663

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

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值