In Jetbot Jupyterlab,always 'killed' when loading models and weights,why?

When I was studying the tutorial ‘collision_avoidance’.The model is alexnet, which can be executed on my laptop, but it can’t be executed on Jetson nano. Why?
At the same time, loading the official model of Pytorch is the same. Why?

Code_1:
import torch
from alexnet import AlexNet
model = AlexNet()
alexnet_path = ‘./weights/alexnet/alexnet_original.pth’
model.load_state_dict(torch.load(alexnet_path))

Code_2:
model = models.alexnet(pretrained=True)

1 Like

Would you share error messages you have?

Hello,
The model can be loaded, but not the pretraining weights.

I’m using the official Pytorch code, and the situation is the same.

as follows:
code: model = models.alexnet(pretrained=True)

Hi @SangYC951010 ,

Thanks for reaching out!

The error indicates that the torch package hasn’t yet been imported. You can do this by calling

import torch

Before calling the code blocks which use it.

Please let me know if this helps or you have any questions.

Best,
John

Hi!
I called torch.The program failed to execute and was killed.

Did you ever get this resolved? I’m seeing exactly the same thing. The python kernel dies at

model = models.alexnet(pretrained=True)

No errors - but when I try to run the next cell, the cell execution counter restarts at [1]. And not surprisingly I get the NameError with ‘torch’.

1 Like