pyhton=3.8,pytorch1.12.1,cuda=11.6
错误1:TypeError: __call__() takes 2 positional arguments but 3 were given
就是说应该传俩参数但是传了仨,我看了下我的transforms文件,在network_files下还有一个transforms文件,这两个文件的两个文件中的Compose 类是不一样的。
我错的原因是把import transforms擅自改成了from torchvision import transforms了
解决:在train.py里导入transforms模块不能乱引入
参考链接:(1条消息) pytorch maskrcnn 报错._transforms __call__() takes 2 positional arguments_走错路的程序员的博客-CSDN博客
错误2:RuntimeError: CUDA out of memory. Tried to allocate 714.00 MiB (GPU 0; 4.00 GiB total capacity; 1.82 GiB already allocated; 0 bytes free; 2.54 GiB reserved in total by PyTorch) If reserved memory is >
解决: 我把batch_size从8改成了4后来改成了2都不行,暂时没解决,跑去玩yolov5了~
参考链接:解决:RuntimeError: CUDA out of memory. Tried to allocate 2.00 MiB_无尽的沉默的博客-CSDN博客
错误3:AttributeError: module numpy has no attribute float .
解决:进入这个红框框文件,将np.float改成float
参考链接:(1条消息) DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`_编程研究坊的博客-CSDN博客