Skip to content

Chapter05: VGG_architecture runs without warning and errors in Google Colab but not Jupyter Notebooks #93

Description

@Br4dski

Hi,
I have downloaded the code for VGG_architecture and when I try to run in Jupyter Notebooks I get warnings and errors, but running in Colab works fine.

The warnings / errors in Jupyter Notebooks are the following:

  1. When I run the cell that contains "model = models.vgg16(pretrained=True).to(device)" I get this warning:
    a. "C:\Users\brad_\AppData\Roaming\Python\Python312\site-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(
    C:\Users\brad_\AppData\Roaming\Python\Python312\site-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=VGG16_Weights.IMAGENET1K_V1. You can also use weights=VGG16_Weights.DEFAULT to get the most up-to-date weights.
    warnings.warn(msg)"
  2. Then when the next cell runs "summary(model, torch.zeros(1,3,224,224));", I get the following warning:
    a. ---> 31 summary(model, torch.zeros(1,3,224,224))
    b. TypeError: rand(): argument 'size' failed to unpack the object at pos 2 with error "type must be tuple of ints,but got Tensor"

Can someone please explain why I'm getting this, I would like to have these example codes running in Jupyter Notebook?

Regards
Brad

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions