AttributeError: module 'torchvision' has no attribute 'transforms'


代碼:maskrcnn-benchmark

Python 3.6.13 |Anaconda, Inc

Traceback (most recent call last):
File "tools/train_net.py", line 18, in <module>
from maskrcnn_benchmark.engine.inference import inference
File "/home/Github/maskrcnn-benchmark/maskrcnn_benchmark/engine/inference.py", line 14, in <module>
from .bbox_aug import im_detect_bbox_aug
File "/home/Github/maskrcnn-benchmark/maskrcnn_benchmark/engine/bbox_aug.py", line 3, in <module>
import torchvision.transforms as TT
AttributeError: module 'torchvision' has no attribute 'transforms'

 

修改:

將import torchvision.transforms as TT修改為 from torchvision import transforms as TT,再次運行正常


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM