SSD运行错误合集

    python3 train.py

报错:

/home/llm/PycharmProjects/Detection-PyTorch-Notebook-master/chapter5/ssd-pytorch/layers/modules/l2norm.py:17: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
  init.constant(self.weight,self.gamma)
/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py:30: UserWarning:
    There is an imbalance between your GPUs. You may want to exclude GPU 1 which
    has less than 75% of the memory or cores of GPU 0. You can do so by setting
    the device_ids argument to DataParallel, or by setting the CUDA_VISIBLE_DEVICES
    environment variable.
  warnings.warn(imbalance_warn.format(device_ids[min_pos], device_ids[max_pos]))
Loading base network...
Initializing weights...
train.py:209: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
  init.xavier_uniform(param)
Loading the dataset...
Training SSD on: VOC0712
Using the specified args:
Namespace(basenet='vgg16_reducedfc.pth', batch_size=32, cuda=True, dataset='VOC', dataset_root='data/VOCdevkit', gamma=0.1, lr=0.001, momentum=0.9, num_workers=4, resume=None, save_folder='weights/', start_iter=0, visdom=False, weight_decay=0.0005)
Traceback (most recent call last):
  File "train.py", line 250, in <module>
    train()
  File "train.py", line 139, in train
    batch_iterator = iter(data_loader)
  File "/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 444, in __iter__
    return self._get_iterator()
  File "/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 390, in _get_iterator
    return _MultiProcessingDataLoaderIter(self)
  File "/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1115, in __init__
    self._reset(loader, first_iter=True)
  File "/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1148, in _reset
    self._try_put_index()
  File "/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1382, in _try_put_index
    index = self._next_index()
  File "/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 671, in _next_index
    return next(self._sampler_iter)  # may raise StopIteration
  File "/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/utils/data/sampler.py", line 247, in __iter__
    for idx in self.sampler:
  File "/home/llm/anaconda3/envs/tf27/lib/python3.8/site-packages/torch/utils/data/sampler.py", line 132, in __iter__
    yield from torch.randperm(n, generator=generator).tolist()
RuntimeError: Expected a 'cuda' device type for generator but found 'cpu'

解决思路:Expected a ‘cuda‘ device type for generator but found ‘cpu‘的解决方法

报错:

RuntimeError: Expected a 'cuda' device type for generator but found 'cpu'

解决思路:RuntimeError: Pin memory thread exited unexpectedly 或 OSError: [Errno 9] Bad file descriptor 的解决方法

报错:

AttributeError: module 'torch.cuda' has no attribute '_UntypedStorage'

待解决......

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值