openai / Video-Pre-Training

Video PreTraining (VPT): Learning to Act by Watching Unlabeled Online Videos
MIT License
1.36k stars 146 forks source link

Update requirements.txt to remove torch version constraint #38

Closed Matoi647 closed 8 months ago

Matoi647 commented 8 months ago

I've noticed a fixed constraint in the requirements.txt file specifying torch==1.9.0. However, I'm using Python 3.10 and CUDA 11.5, which is incompatible with torch 1.9.0. When I ran pip install -r requirements.txt, I encountered the following error:

ERROR: Could not find a version that satisfies the requirement torch==1.9.0 (from versions: 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1)
ERROR: No matching distribution found for torch==1.9.0

Therefore, I manually installed the latest version of torch (2.2.1), and it works perfectly. Perhaps the constraint on the torch version is unnecessary. Removing the specific version constraint would allow users to install the latest compatible version.

Miffyli commented 8 months ago

Hey! Thanks for the PR. Indeed PyTorch 1.9 is not available in the default repos anymore (you have to look at the list of previous versions for the link).

It was pinned as, sometimes, PyTorch changes the logic underneath some of the modules, which could change the results of the model. This is unlikely, but added as a safety precaution.

Given how this could sneakily affect performance of the model for anybody running it down the line, I would like to do one of the following:

1) Exhaustive benchmark of the performance of the model with 1.9 vs. 2.2 (or other PyTorch version). Primarly, running the diamond pickaxe model for, say, 1000 episodes for both, and seeing if the results are still the same. Alternatively,

2) Keep torch==1.9 pin but add the URL to look for it to the requirements.txt. I believe there are ways to do this, so that you can still install with pip install -r requirements.txt and the requirements.txt file specifies where to look for that specific package. We can add a note that people can try using newer torch, but with a cautious reminder that it might change how the model behaves.

Matoi647 commented 8 months ago

For the second option, I've tried to manually install torch 1.9.0 form this URL: https://download.pytorch.org/whl/cu111/torch-1.9.0%2Bcu111-cp39-cp39-linux_x86_64.whl But it still failed because the latest version of Python that supports torch 1.9.0 is Python 3.9. So it's not compatible with Python 3.10, mabye you should also add a note of Python version.

Miffyli commented 8 months ago

Ah yes good catch. The solution in #39 is the correct one for now. Thanks for reporting this and taking the time to write the PRs :).

Closing as resolved.