ryujaehun / pytorch-gpu-benchmark

Using the famous cnn model in Pytorch, we run benchmarks on various gpu.
MIT License
227 stars 85 forks source link

error in type mobilenet_v2 #18

Closed jjziets closed 3 years ago

jjziets commented 3 years ago

I get the following error on Ubuntu 16.04 Driver 460.56 using image pytorch/pytorch:latest 1.8.0

I rented a 4 RTX3090's system on vastai.

Benchmarking Training float precision type mobilenet_v2
mobilenet_v2 model average train time : 149.79285717010498ms
Traceback (most recent call last):
  File "benchmark_models.py", line 156, in <module>
    train_result=train(precision)
  File "benchmark_models.py", line 67, in train
    model = getattr(model_type, model_name)(pretrained=False)
TypeError: __init__() got an unexpected keyword argument 'pretrained'

After this the test.sh repeated by with 3 gpu's.

All 4 is still visible. 
jjziets commented 3 years ago

ok so the error is in models.mobilenet:models.mobilenet.all[1:],

RDouglasSharp commented 3 years ago

I have exactly the same issue on Ubuntu 20.04, running locally...

Benchmarking Training float precision type mobilenet_v2 mobilenet_v2 model average train time : 32.05583095550537ms Traceback (most recent call last): File "benchmark_models.py", line 156, in train_result=train(precision) File "benchmark_models.py", line 67, in train model = getattr(model_type, model_name)(pretrained=False) TypeError: init() got an unexpected keyword argument 'pretrained' end

dejavud commented 3 years ago

work around this by replacing models.mobilenet:models.mobilenet.__all__[1:], to models.mobilenet:models.mobilenet.__all__[1:2] + models.mobilenet.__all__[3:],

pjmartel commented 3 years ago

Ubuntu 18.04 torch 1.10.0 (dev) Nvidia driver 460.91.03 Cuda 11.4

Got a different error in mobilenet:

Traceback (most recent call last):
  File "benchmark_models.py", line 161, in <module>
    train_result=train(precision)
  File "benchmark_models.py", line 71, in train
    model = getattr(model_type, model_name)(pretrained=False)
TypeError: __init__() missing 2 required positional arguments: 'inverted_residual_setting' and 'last_channel'
end

The fix by @dejavud did not work for this.

ryujaehun commented 3 years ago

Sorry I am late. I think torchvision update, which adds mobilenetv3 network, occurring this problem. So now I edit code to cope with the mobilenetv3 network. if someone encouters a similar problem. I recommend downgrading torchvision version.