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

Is a GPU version of TF implied in order to run live_demo.py on a GPU? #120

Open
weirenorweiren opened this issue Sep 8, 2024 · 4 comments

Comments

@weirenorweiren
Copy link

I want to run live_demo.py on a GPU in Windows. The provided requirement files involves jax and tensorflow but live_demo.py only explicitly imports jax. Is a GPU version of tensorflow implied in order to run live_demo.py or jax on a GPU? Actually I am wondering why tensorflow is required in the requirements?

@cdoersch
Copy link
Collaborator

cdoersch commented Sep 8, 2024

Tensorflow is required for some of the dataset loaders for training, but it shouldn't be required for inference (hence why it's not present in requirements_inference.txt or the base dependencies in or toml file). I don't think live_demo.py depends on tensorflow; let me know if I'm missing something.

Even for training, tensorflow shouldn't run on GPU; a CPU versoin should be fine.

@weirenorweiren
Copy link
Author

Hi Carl, it seems live_demo.py requires tensorflow. Is there a way to circumvent this? If not, could you elaborate a bit more of why not tensorflow requiring a GPU version while jax is running on a GPU? I have no knowledge on this but intuitively I feel that if one thing (jax) runs on GPU and everything else would follow especially if it has a GPU version.

Traceback (most recent call last):
File "F:\Wei\tapnet\tapnet\live_demo.py", line 24, in
from tapnet.models import tapir_model
File "F:\Wei\tapnet\tapnet_init_.py", line 21, in
from tapnet.tapvid import evaluation_datasets # pylint:disable=g-importing-member
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "F:\Wei\tapnet\tapnet\tapvid\evaluation_datasets.py", line 33, in
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'

I care about this because of the below statement I found in https://www.tensorflow.org/install/source_windows. If GPU version for tensorflow is a must, I would need to decide whether using a lower version of TF or going for WSL2. Neither is preferred that ideally I hope I just need to install a wheel from https://github.com/cloudhan/jax-windows-builder.

Note: GPU support on native-Windows is only available for 2.10 or earlier versions, starting in TF 2.11, CUDA build is not supported for Windows. For using TensorFlow GPU on Windows, you will need to build/install TensorFlow in WSL2 or use tensorflow-cpu with TensorFlow-DirectML-Plugin

The discussion reminds me of one more thing. Are there any version restrictions for jaxlib and tensorflow? Here are the available wheels from the previous site: https://whls.blob.core.windows.net/unstable/index.html. It only supports a few versions of jaxlib. Would any of those versions be good for live_demo.py? And the same question applies for tensorflow.

@yangyi02
Copy link
Collaborator

yangyi02 commented Sep 13, 2024

Hi weirenorweiren,

Can you try comment this line

from tapnet.tapvid import evaluation_datasets # pylint:disable=g-importing-member

then see if live_demo.py can work without tensorflow dependency?

Thanks.

@weirenorweiren
Copy link
Author

Hi Yi, it works and thanks so much!

Could you also please take a look at the below question I asked in the previous reply? I am now working towards setting up the CUDA environment on Windows and any relevant information is appreciated!

The discussion reminds me of one more thing. Are there any version restrictions for jaxlib and tensorflow? Here are the available wheels from the previous site: https://whls.blob.core.windows.net/unstable/index.html. It only supports a few versions of jaxlib. Would any of those versions be good for live_demo.py? And the same question applies for tensorflow.

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

3 participants