DFL-CNN
DFL-CNN copied to clipboard
TypeError: __init__() got an unexpected keyword argument 'pretrained'
DFL-CNN <==> Part1 : prepare for parameters <==> Begin
DFL-CNN <==> Part1 : prepare for parameters <==> Done
DFL-CNN <==> Part2 : Load Network <==> Begin
Traceback (most recent call last):
File "main.py", line 180, in
File "/home/steven/Documents/test/DFL-CNN/model/DFL.py", line 13, in init
vgg16featuremap = torchvision.models.vgg16_bn(pretrained=True).features
File "/usr/local/lib/python3.5/dist-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'
Hello dejia when I reappearance your code this error happened ,Where is the problem?
Maybe the version of torchvision should be updated.
https://forums.fast.ai/t/forward-got-an-unexpected-keyword-argument-pretrained/80582
Try this, it worked for me.
import fastai model = fastai.vision.model.YOURMODELHERE