yu4u/age-estimation-pytorch

Run time error

Opened this issue · 1 comments

error code >>

Traceback (most recent call last):
File "train.py", line 244, in
main()
File "train.py", line 151, in main
model = get_model(model_name=cfg.MODEL.ARCH)
File "C:\Users\intel\Desktop\capstone\age-estimation-pytorch-master\model.py", line 7, in get_model
model = pretrainedmodels.dictmodel_name
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pretrainedmodels\models\senet.py", line 430, in se_resnext50_32x4d
initialize_pretrained_model(model, num_classes, settings)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\pretrainedmodels\models\senet.py", line 373, in initialize_pretrained_model
model.load_state_dict(model_zoo.load_url(settings['url']))
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\hub.py", line 506, in load_state_dict_from_url
return torch.load(cached_file, map_location=map_location)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization.py", line 529, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\intel\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization.py", line 709, in _legacy_load
deserialized_objects[key]._set_from_file(f, offset, f_should_read_directly)
RuntimeError: unexpected EOF, expected 54168 more bytes. The file might be corrupted.

The error occurred as above.
I tried several times, but the same error occurs.
I tried entering this code.

python train.py --data_dir /appa-real-release TRAIN.BATCH_SIZE 16

I tried entering the batch size differently, but the same error occurred.
Please help me how to solve it.

yu4u commented

The downloaded pretrained weights seems broken.
Could you try:

python train.py --data_dir /appa-real-release TRAIN.BATCH_SIZE 16 MODEL.ARCH resnet34

If this works without error, the problem is due to the weights. Removing cache might help (not sure