Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ doc/
/cmake-build-debug/_deps/
/cmake-build-release/
/cmake-build-release/_deps/

/.vscode
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ pip3 install torch==1.13.0 torchvision torchaudio
(w/o CUDA)

```shell
pip3 install torch==1.13.0 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cpu
pip3 install --ignore-installed torch==1.13.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
```

*Note: Conflict between torch1.13.0+cpu and torchaudio+cpu may occur under python version > 3.10*

#### (Optional) Pytorch with Cuda backend on jetson

Refer to https://docs.nvidia.com/deeplearning/frameworks/install-pytorch-jetson-platform/index.html.
Expand Down Expand Up @@ -118,10 +120,20 @@ pip install torchviz
```shell
export CUDACXX=/usr/local/cuda/bin/nvcc
mkdir build && cd build
```

Build for release by default:
```shell
cmake -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` ..
make
```

Or you can build with debug mode to debug cpp dynamic lib:
```shell
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=`python3 -c 'import torch;print(torch.utils.cmake_prefix_path)'` ..
make
```

## An open box test

```shell
Expand Down Expand Up @@ -201,3 +213,4 @@ You will find the figures then.
2. Some pytorch version can not work well with liblog4cxx and googletest, so we diabled it.
3. Clion may fail to render and highlight the torch apis. In this case, kindly type a random line of "555"
to validate the highlight when you need it, and comment it during a compile. :)
4. When setting up torch for cpu under python version > 3.10, torch == 1.13.0 would conflict with torchaudio according to https://pytorch.org/audio/stable/installation.html. Use Python version <= 3.10 for smooth installation.