- 博客(3)
- 收藏
- 关注
原创 RuntimeError: Invalid device string: ‘0,1,2,3‘
开头加上import osos.environ[‘CUDA_VISIBLE_DEVICES’] = ‘0,1,2,3’改为:device = torch.device(‘cuda’ if torch.cuda.is_available() else ‘cpu’ )
2022-05-23 16:22:07
7311
原创 UnboundLocalError: local variable ‘cls_num‘ referenced before assignment
函数中的局部变量,报出unboundLocal Error问题,是出现在赋值的问题上,报错是因为系统认为cls_num 不一定能被赋值,要先对其进行赋值。好了如果在子程序中对全局变量的操作任然报错UnboundLocalError: local variable ‘xxxxx’ referenced before assignment用global关键字来进行说明xxxxx该变量是全局变量...
2022-05-17 19:43:47
588
原创 ImportError: cannot import name ‘_validate_lengths‘ 解决方法
更新scikit-imagepip install --upgrade scikit-image
2022-05-16 16:48:55
216
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人