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

about gpu #1

Open
iaOlivia opened this issue Oct 4, 2023 · 6 comments
Open

about gpu #1

iaOlivia opened this issue Oct 4, 2023 · 6 comments

Comments

@iaOlivia
Copy link

iaOlivia commented Oct 4, 2023

hi,
Thanks for your contribution!
I see you used 5x2080ti gpu.2x4090 gpu with 24 GB each can run the project?

@yilmazkorkmaz1
Copy link
Collaborator

Hi, sorry for late response. Did not receive any notification.

Of course. A single 4090 would be enough for both training and inference.

@greenyjwk
Copy link

greenyjwk commented May 14, 2024

hi, Thanks for your contribution! I see you used 5x2080ti gpu.2x4090 gpu with 24 GB each can run the project?

How would you be able to run TensorFlow version1 on RTX 4090 with the prerequisites mentioned in the README file? Because I thought the RTX 4090 requires CUDA 11.8 at least.

@yilmazkorkmaz1
Copy link
Collaborator

yilmazkorkmaz1 commented May 14, 2024

Hi Ji,

I have not used 4090 at that time but it might be doable using either these solutions (https://forums.developer.nvidia.com/t/can-nvidia-tensorflow-1-x-be-used-with-rtx-4090/241211) or migrating to TF2 (https://www.tensorflow.org/guide/migrate).

You can start with using tf2:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
whenever you import tensorflow to deactivate v2 specialities (other than this you probably need to change a few lines in other dnnlib files).
You might check these repos too.
https://github.com/icon-lab/FedGIMP
https://github.com/christophmeyer/stylegan2-tf2

@greenyjwk
Copy link

Hello Yilmaz,

Thank you for the response.
Yes, I used the below approach as you suggested, but I have been facing with the following error.

[tf2 -> tf1]
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

[Error]
File "/home/jie/SLATER-main_tfv2/dnnlib/tflib/network.py", line 149, in _init_graph
out_expr = self._build_func(*self.input_templates, **build_kwargs)
File "", line 1211, in G_synthesis
File "", line 250, in get_positional_embeddings
AttributeError: module 'tensorflow' has no attribute 'variable_scope'

By the way, thank you for suggesting other repos.

@yilmazkorkmaz1
Copy link
Collaborator

yilmazkorkmaz1 commented May 15, 2024

Yes, it is expected to see these kind of migration issues. These might help.
https://www.tensorflow.org/api_docs/python/tf/compat/v1/variable_scope
https://www.tensorflow.org/guide/migrate/model_mapping

Or easier solution might be to check the repos I shared in the previous response.

@greenyjwk
Copy link

greenyjwk commented May 16, 2024

Thank you so much for the suggestion.

As you suggested, I have tried three different ways, but the error still occurs.

  1. For all the python scripts that import tensorflow, I changed to tensorflow.compat.v1. And, the following error still occured,
    AttributeError: module 'tensorflow' has no attribute 'variable_scope' still occurs from the network.py.

  2. As you specified there is also network.py file in FedGIMP, so I compared and changed some lines from network.py from SLATER. The error still occurred.

  3. I replaced the (networks.py from SLATER) With FedGIMP/dnnlin/tflib/network.py, where the error comes out. The errror still occurred.

For your reference, the error occured "SLATER-main_tfv2/dnnlib/tflib/network.py", line 143
out_expr = self._build_func(*self.input_templates, **build_kwargs)

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