Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with requirements.txt #1

Open
belguutei opened this issue Feb 7, 2024 · 1 comment
Open

Error with requirements.txt #1

belguutei opened this issue Feb 7, 2024 · 1 comment

Comments

@belguutei
Copy link

Hello,

I was trying to follow along your tutorial, but when I ran the command "pip install -r requirements.txt" I got this error:
ERROR: Could not find a version that satisfies the requirement torch==1.8.1+cu111 (from versions: 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0)
ERROR: No matching distribution found for torch==1.8.1+cu111

I don't have much experience with coding since I studied math in school.
Please help me

@ali-izhar
Copy link

ali-izhar commented Apr 18, 2024

This is a common issue when specific versions are packaged with CUDA support in the requirements.txt file. To resolve this, you'll need to install PyTorch directly from the official PyTorch website. Please follow these steps:

  1. If you're using a virtual environment (highly recommended to avoid conflicts between projects), activate it with one of these commands:

    • On macOS/Linux: source <env-name>/bin/activate
    • On Windows: <env-name>\Scripts\activate
      Replace <env-name> with the name of your virtual environment. Using a virtual environment helps isolate and manage project dependencies.
  2. Install Other Requirements: Remove any PyTorch related lines (torch, torchvision, torchaudio) from your requirements.txt file, then install the remaining requirements: pip install -r requirements.txt

  3. Install PyTorch:

    • If you're using a GPU, run the following command (adjust the CUDA version if needed).
      pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

    • For CPU-only installations, use
      pip install torch torchvision torchaudio

You can find the command that matches your operating system and CUDA version on the PyTorch installation page: https://pytorch.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants