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

Update main.py #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update main.py #116

wants to merge 1 commit into from

Conversation

ashok2216-A
Copy link

he torchvision.transforms.Scale method has been deprecated and removed in recent versions of torchvision. You should replace it with torchvision.transforms.Resize.

Here’s how you can update the code to use transforms.Resize instead of transforms.Scale:

Locate the Use of transforms.Scale:

Find the lines in your code where transforms.Scale is used. According to your traceback, it seems to be around line 124 in main.py.

Replace transforms.Scale with transforms.Resize:

transforms.Scale(int(imsize * 76 / 64)),

to:

transforms.Resize(int(imsize * 76 / 64)),
Example
Here’s an example of how your main.py might look after the change:

import torchvision.transforms as transforms

Example usage of transforms.Resize instead of transforms.Scale transform = transforms.Compose([

transforms.Resize(int(imsize * 76 / 64)),
transforms.ToTensor(),
# Add other transformations as needed

])

he torchvision.transforms.Scale method has been deprecated and removed in recent versions of torchvision. You should replace it with torchvision.transforms.Resize.

Here’s how you can update the code to use transforms.Resize instead of transforms.Scale:

Locate the Use of transforms.Scale:

Find the lines in your code where transforms.Scale is used. According to your traceback, it seems to be around line 124 in main.py.

Replace transforms.Scale with transforms.Resize:

transforms.Scale(int(imsize * 76 / 64)),

to:

transforms.Resize(int(imsize * 76 / 64)),
Example
Here’s an example of how your main.py might look after the change:

import torchvision.transforms as transforms

# Example usage of transforms.Resize instead of transforms.Scale
transform = transforms.Compose([
    transforms.Resize(int(imsize * 76 / 64)),
    transforms.ToTensor(),
    # Add other transformations as needed
])
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

Successfully merging this pull request may close these issues.

1 participant