WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 574 forks source link

No module named 'mc.build.lib' #155

Closed JustinhoCHN closed 3 years ago

JustinhoCHN commented 3 years ago

My installation step:

docker run --gpus device=1 --name yolov4_csp -it -v ~/projects/ScaledYOLOv4:/yolo --shm-size=64g nvcr.io/nvidia/pytorch:20.06-py3
cd /
git clone https://github.com/JunnYu/mish-cuda
cd mish-cuda
python setup.py build install

finished with info:

Using /opt/conda/lib/python3.6/site-packages
Finished processing dependencies for mish-cuda==0.0.3
cd /yolo
python test.py --img 896 --conf 0.001 --batch 8 --device 0 --data coco.yaml --weights weights/yolov4-p5.pt

error raised:


/opt/conda/lib/python3.6/site-packages/torch/serialization.py:644: SourceChangeWarning: source code of class 'models.yolo.Model' has changed. you can retrieve the original source code by accessing the object's source attribute or set `torch.nn.Module.dump_patches = True` and use the patch tool to revert the changes.
  warnings.warn(msg, SourceChangeWarning)
Traceback (most recent call last):
  File "test.py", line 278, in <module>
    opt.verbose)
  File "test.py", line 55, in test
    model = attempt_load(weights, map_location=device)  # load FP32 model
  File "/yolo/models/experimental.py", line 137, in attempt_load
    model.append(torch.load(w, map_location=map_location)['model'].float().fuse().eval())  # load FP32 model
  File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 580, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/opt/conda/lib/python3.6/site-packages/torch/serialization.py", line 760, in _legacy_load
    result = unpickler.load()
ModuleNotFoundError: No module named 'mc.build.lib'

How to solve it? Thanks.

WongKinYiu commented 3 years ago

It seems your weights file is out-of-date. I guess you downloaded weights file other place. Please try to download weights file from https://github.com/WongKinYiu/ScaledYOLOv4/tree/yolov4-large#yolov4-large

JustinhoCHN commented 3 years ago

It seems your weights file is out-of-date. I guess you downloaded weights file other place. Please try to download weights file from https://github.com/WongKinYiu/ScaledYOLOv4/tree/yolov4-large#yolov4-large

Yeah you are right, my weights were downloaded weeks ago, after replacing the newest weights, I can run it succeccfully. Thanks again.