Hi! I’m training a machine learning model in Jupyter Code Workspace and trying to load the pre-trained ResNet50 model from PyTorch. However, I’m encountering an issue where the environment doesn’t allow me to download the model. Here’s my code:
from torchvision import models
from torchvision.models import ResNet50_Weights
# Load the ResNet50 model pre-trained on ImageNet
model = models.resnet50(weights=ResNet50_Weights.IMAGENET1K_V1)
This code works fine in a Kaggle notebook, but not on my environment. The AI Assist tool in Code Workspaces says:
Code Workspaces in Foundry operate in a secure environment with controlled network access, which may restrict direct downloads from external sources (like the PyTorch model zoo).
Are there any workarounds for this?