We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import torch import torchvision from torchvision.models.detection.anchor_utils import AnchorGenerator
images, targets = next(iterator) images = list(image.to(device) for image in images)
with torch.no_grad(): model.to(device) model.eval() output = model(images)
print("Predictions: \n", output)
traced_model = torch.jit.trace(model, output)
#traced_model = torch.jit.trace(model, example_input)
traced_model.save('traced_model.pt')
AttributeError: 'str' object has no attribute 'shape'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
import torch
import torchvision
from torchvision.models.detection.anchor_utils import AnchorGenerator
Load the pre-trained model from the .pth file
images, targets = next(iterator)
images = list(image.to(device) for image in images)
with torch.no_grad():
model.to(device)
model.eval()
output = model(images)
print("Predictions: \n", output)
traced_model = torch.jit.trace(model, output)
Trace the model using TorchScript
#traced_model = torch.jit.trace(model, example_input)
Save the traced model to a .pt file
traced_model.save('traced_model.pt')
AttributeError: 'str' object has no attribute 'shape'
The text was updated successfully, but these errors were encountered: