simplest_FasterRcnn_pytorch icon indicating copy to clipboard operation
simplest_FasterRcnn_pytorch copied to clipboard

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

Open yuanjinsheng opened this issue 6 years ago • 2 comments

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'

yuanjinsheng avatar Oct 21 '18 02:10 yuanjinsheng

@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.

Kyle1993 avatar Oct 21 '18 03:10 Kyle1993

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

yuanjinsheng avatar Oct 21 '18 05:10 yuanjinsheng