Skip to content

Commit

Permalink
[Doc] Document undefined symbol error with torch version < 1.13 (pyto…
Browse files Browse the repository at this point in the history
…rch#707)

* Create VERSIONING_ISSUES.md

* Update README.md

* Update README.md

* Update VERSIONING_ISSUES.md

* Update VERSIONING_ISSUES.md

* Update README.md

* Update VERSIONING_ISSUES.md

* Update VERSIONING_ISSUES.md

* Update VERSIONING_ISSUES.md
  • Loading branch information
nickspell authored Nov 24, 2022
1 parent d27d070 commit 3105819
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,9 @@ and not
OS: macOS **** (x86_64)
```

Versioning issues can cause error message of the type ```undefined symbol``` and such. For these, refer to the [versioning issues document](knowledge_base/VERSIONING_ISSUES.md) for a complete explanation and proposed workarounds.


## Running examples
Examples are coded in a very similar way but the configuration may change from one algorithm to another (e.g. async/sync data collection, hyperparameters, ratio of model updates / frame etc.)

Expand Down
23 changes: 23 additions & 0 deletions knowledge_base/VERSIONING_ISSUES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Versioning Issues

## Pytorch version
This issue is related to https://github.com/pytorch/rl/issues/689. Using PyTorch versions <1.13 and installing stable package leads to undefined symbol errors. For example:
```
ImportError: /usr/local/lib/python3.7/dist-packages/torchrl/_torchrl.so: undefined symbol: _ZN8pybind116detail11type_casterIN2at6TensorEvE4loadENS_6handleEb
```

### How to reproduce
1. Create an Colab Notebook (at 24/11/2022 Colab enviroment has Python 3.7 and Pytorch 1.12 installed by default).
2. ``` !pip install torchrl ```
3. ``` import torchrl ```

In Colab you can solve the issue by running:
```
!pip3 install torch --extra-index-url https://download.pytorch.org/whl/cpu -U
```
before the ```!pip install torchrl``` command. This will install the latest pytorch. Instructions can be found [here](https://pytorch.org/get-started/locally/).

### Workarounds
There are two workarounds to this issue
1. Install/upgrade to the latest pytorch release before installing torchrl.
2. If you need to use a previous pytorch relase: Install functorch version related to your torch distribution: e.g. ``` pip install functorch==0.2.0 ``` and install library from source ``` pip install git+https://github.com/pytorch/rl@<lib_version_here> ```.

0 comments on commit 3105819

Please sign in to comment.