convert-onnx-to-caffe2 command not found

In this troubleshooting guide we learn how to fix convert-onnx-to-caffe2 command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

convert-onnx-to-caffe2: command not found

or when using sudo you get the following error message

sudo: convert-onnx-to-caffe2: command not found

Solutions to convert-onnx-to-caffe2: command not found

How To Fix convert-onnx-to-caffe2: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu convert-onnx-to-caffe2 is provided by python3-torch package.

python3-torch is:

PyTorch is a Python package that provides two high-level features:

(1) Tensor computation (like NumPy) with strong GPU acceleration (2) Deep neural networks built on a tape-based autograd system

You can reuse your favorite Python packages such as NumPy, SciPy and Cython to extend PyTorch when needed.

This is the CPU-only version of PyTorch and Caffe2 (Python interface).

To fix this problem, we can install more using the command below.

sudo apt-get -y install python3-torch

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install python3-torch.

sudo apt -y install python3-torch

Or if you have aptitude installed you can use the following command.

sudo aptitude install python3-torch

Summary

In this tutorial we learn how to fix convert-onnx-to-caffe2 command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.