Setting Up Netron Server
Introduction
Netron is a useful tool for neural network visualization. Sometimes the neural network files are on the server and we don’t want to transfer the files, some of which are large, to local computer and view locally. Fortunately, Netron has a Python server version which allows the user to set up a Netron host on the remote server and the user will just have to connect to the server and view the neural network remotely.
In this blog post, I would like to quickly talk about how to set up Netron server.
Netron Sever Setup
SSH to Remote Server
SSH to the remote server with port binding using the following command.
1 | $ ssh -L 127.0.0.1:8080:0.0.0.0:8080 username@ip-address |
8080
is the default port used by Netron server.
Install Netron Sever
Netron server is only available for the Python. Install Netron via pip
instead of snap
using the following command.
1 | $ pip3 install netron |
In this case, Netron was not accessible from PATH
after installation. We will have to update PATH
manually by adding export PATH="$HOME/.local/bin:$PATH"
to ~/.bash_profile
. Then source the updated file by running the following command.
1 | $ source ~/.bash_profile |
Run Netron Server
Start a Netron server for a certain neural network ONNX file, such as ResNet18, from the server using the following command.
1 | $ wget https://github.com/onnx/models/raw/main/vision/classification/resnet/model/resnet18-v2-7.onnx |
View Neural Network
Open a browser from the local computer and access the neural network via URL 127.0.0.1:8080
.
References
Setting Up Netron Server