Hi there,
I’m trying to run webcam feed based inference on a pretrained pytorch model on the Jetson Nano. When I run a frame through the network I get the
Illegal instruction (core dumped)

error message. I can reliably reproduce this error using the following minimal script:
import torch
import torch.nn as nn

lstm = nn.LSTM(63, 70, 1, True)
x = torch.randn(1,14,63)
lstm(x)

The dimensions of the model and the input are chosen to fit the data I’m using. In reality the model should perform inference on tensors of size (1,175,63). Interestingly running the following:
import torch
import torch.nn as nn

lstm = nn.LSTM(63, 70, 1, True)
for i in range(175):
     x = torch.randn(1,i,63)
     lstm(x)

produces output until the size of the second dimension of x reaches 14 at which point the core dumped error message occurs. Any ideas what’s happening here? I’ve read that torch has some issues with old CPUs but seeing as it seems to be working up to a certain point I doubt this was an issue. I tested this by trying out some solutions posted here which involved entering
export OPENBLAS_CORETYPE=ARMV8

before running the script in the terminal. I’m also running numpy version 1.19.4 which was suggested to be a solution for a similar problem in the above thread so that’s probably not the issue.
Some specs:
python version: 3.6.9
numpy version: 1.19.5
torch version: 1.9.0
system: Jetson Nano 2GB
os: Ubuntu 18.04.5 LTS (Bionic Beaver)
many thanks.