xuebinqin / U-2-Net

The code for our newly accepted paper in Pattern Recognition 2020: "U^2-Net: Going Deeper with Nested U-Structure for Salient Object Detection."
Apache License 2.0
8.31k stars 1.43k forks source link

RuntimeError: unexpected EOF, The file might be corrupted #354

Open ghost opened 1 year ago

ghost commented 1 year ago

When runing: python u2net_portrait_composite.py -s 20 -a 0.5

it returns an Error : RuntimeError: unexpected EOF, expected 2332171 more bytes.

20
0.5
--------------------
Number of images:  10
...load U2NET---173.6 MB
Traceback (most recent call last):
  File "/content/U-2-Net/u2net_portrait_composite.py", line 141, in <module>
    main()
  File "/content/U-2-Net/u2net_portrait_composite.py", line 111, in main
    net.load_state_dict(torch.load(model_dir))
  File "/usr/local/lib/python3.9/dist-packages/torch/serialization.py", line 795, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/usr/local/lib/python3.9/dist-packages/torch/serialization.py", line 1020, in _legacy_load
    typed_storage._storage._set_from_file(
RuntimeError: unexpected EOF, expected 2332171 more bytes. The file might be corrupted.