admin管理员组

文章数量:1123950

I am trying to run this GitHub repository locally. However, when I try to run their test command (with their test images), I run into this error:

AttributeError: Can't get attribute 'MulticlassRegression' on <module 'models' from './micronuclAI/src/model/models.py'>'. The phrase MulticlassRegression only exists in the files ./micronuclAI_model/micronuclai.pt and ./src/model/__pycache__/models.cpython-311.pyc.

traceback

Traceback (most recent call last):
File ".../micronuclAI/./src/model/prediction2.py", line 152, in
main(args)
File ".../micronuclAI/./src/model/prediction2.py", line 100, in main
model = torch.load(args.model, map_location=args.device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "user/.local/lib/python3.11/site-packages/torch/serialization.py", line 1025, in load
return _load(opened_zipfile,
^^^^^^^^^^^^^^^^^^^^^
File "user/.local/lib/python3.11/site-packages/torch/serialization.py", line 1446, in _load
result = unpickler.load()
^^^^^^^^^^^^^^^^
File "user/.local/lib/python3.11/site-packages/torch/serialization.py", line 1439, in find_class
return super().find_class(mod_name, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Can't get attribute 'MulticlassRegression' on <module 'models' from './micronuclAI/src/model/models.py'>

UPDATE

I found that renaming the micronuclAI class to MulticlassRegression. The authors probably renamed the class at the end, after creating the .pt file.

The authors fixed this error separately, but I ran into another issue on their new code, which I have mentioned in the issue on the repository.

本文标签: