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

A problem when setting up an environment #22

Open
hothot9532 opened this issue Apr 11, 2024 · 6 comments
Open

A problem when setting up an environment #22

hothot9532 opened this issue Apr 11, 2024 · 6 comments

Comments

@hothot9532
Copy link

hothot9532 commented Apr 11, 2024

When I perform:
cd CIHP_PARSING
python human_parse.py --brand Example_top
When this code, error:
235f08353798aba94d380002e13e9337
3b29b7611cb2b372b173a0e2838b7e46
fff2762a00dced9df8da1a24a95cd860
I have already executed it under ‘code’ : pip3 install -r requirements.txt
Why can't it detect my GPU? I checked my GPU and it did work. I haven't used tensorflow much before, how can I solve this situation?

@SalehAhmad1
Copy link

I have got the same issue. Bump!

@netsalesbg-ltd
Copy link

It seems like you do not have cuda drivers installed.

@SalehAhmad1
Copy link

It seems like you do not have Cuda drivers installed.

I feel like this issue is because "tensorflow" can't detect the GPU, because when we do torch.cuda.is_available() we get True.

@sahilshukla3003
Copy link

When I perform: cd CIHP_PARSING python human_parse.py --brand Example_top When this code, error: 235f08353798aba94d380002e13e9337 3b29b7611cb2b372b173a0e2838b7e46 fff2762a00dced9df8da1a24a95cd860 I have already executed it under ‘code’ : pip3 install -r requirements.txt Why can't it detect my GPU? I checked my GPU and it did work. I haven't used tensorflow much before, how can I solve this situation?

either reduce the size of input models images or use gpu with tensorflow (currently it is running on cpu which increases load on the ram hence the process terminates)

@ChiehYunChen
Copy link
Collaborator

Hi guys,

It seems Tensorflow doesn't detect your GPU, since I have put tf.config.list_physical_devices('GPU') to help check whether it can access the GPU. Regarding your error message, it outputs [], which means it doesn't see any GPU.

Suggestions from Claude: (I think the fourth one might be helpful)

My prompt: Why tf.config.list_physical_devices('GPU') get [] but torch.cuda.is_available() is True?

This situation can occur when you have a CUDA-capable GPU installed on your system, but it is not properly detected or configured by TensorFlow.

Here are a few possible reasons why tf.config.list_physical_devices('GPU') returns an empty list [] while torch.cuda.is_available() is True:

  1. CUDA Driver Issue: TensorFlow requires a compatible CUDA driver to be installed on your system to detect and utilize the GPU. If the CUDA driver is not installed or is not compatible with the version of TensorFlow you're using, TensorFlow may not be able to detect the GPU, even though PyTorch can.
  2. cuDNN Issue: TensorFlow also requires the cuDNN library to be installed and configured properly for GPU support. If cuDNN is missing or not properly configured, TensorFlow may not be able to detect the GPU.
  3. Permissions Issue: On some systems, especially in shared environments or clusters, there might be permission issues that prevent TensorFlow from accessing the GPU devices.
  4. Compatibility Issue: It's possible that the version of TensorFlow you're using is not compatible with the GPU driver or the GPU hardware on your system, while PyTorch's version is compatible.
  5. GPU Memory Allocation: In some cases, TensorFlow may be unable to allocate enough GPU memory to initialize the GPU devices, leading to an empty list.

To resolve this issue, you can try the following steps:

  1. Update CUDA and cuDNN: Ensure that you have the latest compatible versions of CUDA and cuDNN installed and configured correctly for your system and the versions of TensorFlow and PyTorch you're using.
  2. Check Permissions: If you're working in a shared environment or cluster, ensure that you have the necessary permissions to access the GPU devices.
  3. Install GPU-enabled TensorFlow: If you're using a CPU-only version of TensorFlow, you may need to install the GPU-enabled version of TensorFlow that matches your GPU hardware and CUDA/cuDNN versions.
  4. Check TensorFlow Configuration: Ensure that TensorFlow is configured correctly to detect and use the available GPU devices. You can check the TensorFlow configuration by running tf.config.list_physical_devices('GPU') and tf.config.experimental.list_physical_devices('GPU') and inspecting the output.
  5. Increase GPU Memory: If TensorFlow is unable to allocate enough GPU memory, you can try increasing the available GPU memory by adjusting the configuration or running other GPU-intensive processes.

If the issue persists after trying these steps, you may need to investigate further or seek assistance from the TensorFlow and PyTorch communities or documentation for your specific setup and environment.

@hothot9532
Copy link
Author

Hi guys,

It seems Tensorflow doesn't detect your GPU, since I have put tf.config.list_physical_devices('GPU') to help check whether it can access the GPU. Regarding your error message, it outputs [], which means it doesn't see any GPU.

Suggestions from Claude: (I think the fourth one might be helpful)

My prompt: Why tf.config.list_physical_devices('GPU') get [] but torch.cuda.is_available() is True?

This situation can occur when you have a CUDA-capable GPU installed on your system, but it is not properly detected or configured by TensorFlow.

Here are a few possible reasons why tf.config.list_physical_devices('GPU') returns an empty list [] while torch.cuda.is_available() is True:

  1. CUDA Driver Issue: TensorFlow requires a compatible CUDA driver to be installed on your system to detect and utilize the GPU. If the CUDA driver is not installed or is not compatible with the version of TensorFlow you're using, TensorFlow may not be able to detect the GPU, even though PyTorch can.
  2. cuDNN Issue: TensorFlow also requires the cuDNN library to be installed and configured properly for GPU support. If cuDNN is missing or not properly configured, TensorFlow may not be able to detect the GPU.
  3. Permissions Issue: On some systems, especially in shared environments or clusters, there might be permission issues that prevent TensorFlow from accessing the GPU devices.
  4. Compatibility Issue: It's possible that the version of TensorFlow you're using is not compatible with the GPU driver or the GPU hardware on your system, while PyTorch's version is compatible.
  5. GPU Memory Allocation: In some cases, TensorFlow may be unable to allocate enough GPU memory to initialize the GPU devices, leading to an empty list.

To resolve this issue, you can try the following steps:

  1. Update CUDA and cuDNN: Ensure that you have the latest compatible versions of CUDA and cuDNN installed and configured correctly for your system and the versions of TensorFlow and PyTorch you're using.
  2. Check Permissions: If you're working in a shared environment or cluster, ensure that you have the necessary permissions to access the GPU devices.
  3. Install GPU-enabled TensorFlow: If you're using a CPU-only version of TensorFlow, you may need to install the GPU-enabled version of TensorFlow that matches your GPU hardware and CUDA/cuDNN versions.
  4. Check TensorFlow Configuration: Ensure that TensorFlow is configured correctly to detect and use the available GPU devices. You can check the TensorFlow configuration by running tf.config.list_physical_devices('GPU') and tf.config.experimental.list_physical_devices('GPU') and inspecting the output.
  5. Increase GPU Memory: If TensorFlow is unable to allocate enough GPU memory, you can try increasing the available GPU memory by adjusting the configuration or running other GPU-intensive processes.

If the issue persists after trying these steps, you may need to investigate further or seek assistance from the TensorFlow and PyTorch communities or documentation for your specific setup and environment.

Thank you for your solution, which is detailed and effective and gives me experience and knowledge

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

5 participants