Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colab Load Pretrained Model Error #98

Open
KihongK opened this issue Feb 15, 2024 · 2 comments
Open

colab Load Pretrained Model Error #98

KihongK opened this issue Feb 15, 2024 · 2 comments

Comments

@KihongK
Copy link

KihongK commented Feb 15, 2024

Errors occured at colab Step2 (without any modifications)

download DIORv1_64.
/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
  warnings.warn(
/usr/local/lib/python3.10/dist-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=VGG19_Weights.IMAGENET1K_V1`. You can also use `weights=VGG19_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Downloading: "https://download.pytorch.org/models/vgg19-dcbb9e9d.pth" to /root/.cache/torch/hub/checkpoints/vgg19-dcbb9e9d.pth
100%|██████████| 548M/548M [00:06<00:00, 92.7MB/s]
load vgg ckpt from torchvision dict.
[init] init pre-trained model vgg.
initialize network with orthogonal
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-5-77bd5b5628e0>](https://localhost:8080/#) in <cell line: 34>()
     32 download_from_gdrive("checkpoints", "DIORv1_64", "1MyHq-P0c8zz7ey7p_HTTZKeMie5ZuNlb")
     33 
---> 34 model = DIORModel(opt)
     35 model.setup(opt)
     36 

12 frames
[/usr/local/lib/python3.10/dist-packages/skimage/_shared/utils.py](https://localhost:8080/#) in copy_func(f, name)
    195 
    196     """
--> 197     return types.FunctionType(f.__code__, f.__globals__, name or f.__name__,
    198                               f.__defaults__, f.__closure__)
    199 

AttributeError: 'numpy._ArrayFunctionDispatcher' object has no attribute '__code__'
@ArnabChatterjee20k
Copy link

Facing the same error

@rizavelioglu
Copy link

rizavelioglu commented Apr 29, 2024

@KihongK @ArnabChatterjee20k Resolved the issue with:

pip install numpy==1.22

So, downgrading numpy works.

Edit: scipy complains about numpy version, so, it's better to install pip install numpy==1.22.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants