Kyle1993 / simplest_FasterRcnn_pytorch

15 stars 3 forks source link

TypeError: __init__() got an unexpected keyword argument 'pretrained' #1

Open yuanjinsheng opened 5 years ago

yuanjinsheng commented 5 years ago

dear,when i run the test.py, has the problem as follow:

Connected to pydev debugger (build 182.4505.26) Traceback (most recent call last): File "/home/yjs/Downloads/pycharm/helpers/pydev/pydevd.py", line 1664, in main() File "/home/yjs/Downloads/pycharm/helpers/pydev/pydevd.py", line 1658, in main globals = debugger.run(setup['file'], None, None, is_module) File "/home/yjs/Downloads/pycharm/helpers/pydev/pydevd.py", line 1068, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/yjs/Downloads/pycharm/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/yjs/Downloads/simplest_FasterRcnn_pytorch-master/test.py", line 10, in model = FasterRCNNVGG16(opt) File "/home/yjs/Downloads/simplest_FasterRcnn_pytorch-master/model/faster_rcnn_vgg16.py", line 102, in init vgg16 = vgg16_bn(pretrained=True) File "/home/yjs/.conda/envs/py36-tf13/lib/python3.6/site-packages/torchvision/models/vgg.py", line 130, in vgg16_bn return VGG(make_layers(cfg['D'], batch_norm=True), **kwargs) TypeError: init() got an unexpected keyword argument 'pretrained'

Kyle1993 commented 5 years ago

@yuanjinsheng sorry,I didn't met the problem, and base on it's source code on github(https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py), it has the argument 'pretrained' try upgrade your torchvision? btw, here have some bugs in this code which means it can't predict accurately, I am still modifying it.

yuanjinsheng commented 5 years ago

@Kyle1993 thank you for your answer. i have upgrade the torchvision now, and there is no problem.