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 while running encode.py #24

Open
SrikarNamburu opened this issue Oct 15, 2019 · 7 comments · May be fixed by #32
Open

error while running encode.py #24

SrikarNamburu opened this issue Oct 15, 2019 · 7 comments · May be fixed by #32

Comments

@SrikarNamburu
Copy link

Facing this error

Traceback (most recent call last):
File "encode_images.py", line 80, in
main()
File "encode_images.py", line 53, in main
generator = Generator(Gs_network, args.batch_size, randomize_noise=args.randomize_noise)
File "/content/gdrive/My Drive/RI/stylegan-encoder/encoder/generator_model.py", line 35, in init
self.generator_output = self.graph.get_tensor_by_name('G_synthesis_1/_Run/concat:0')
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3783, in get_tensor_by_name
return self.as_graph_element(name, allow_tensor=True, allow_operation=False)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3607, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/ops.py", line 3649, in _as_graph_element_locked
"graph." % (repr(name), repr(op_name)))
KeyError: "The name 'G_synthesis_1/_Run/concat:0' refers to a Tensor which does not exist. The operation, 'G_synthesis_1/_Run/concat', does not exist in the graph."

@GuillaumeMMM
Copy link

I could fix this issue by going back to using tensorflow-gpu==1.14

@Radeeswar
Copy link

Radeeswar commented Nov 20, 2019

Hi, After installing tensorflow-gpu==1.14 I am getting error as follows. I am executing in Google Colab.

InvalidArgumentError: Cannot assign a device for operation learnable_dlatents/read: node learnable_dlatents/read (defined at /content/stylegan-encoder/encoder/generator_model.py:15) was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:XLA_CPU:0, /job:localhost/replica:0/task:0/device:XLA_GPU:0 ]. Make sure the device specification refers to a valid device.
[[learnable_dlatents/read]]

Any suggestions Please. Ty!

@taniyaghosh29
Copy link

Hi, After installing tensorflow-gpu==1.14 I am getting error as follows. I am executing in Google Colab.

InvalidArgumentError: Cannot assign a device for operation learnable_dlatents/read: node learnable_dlatents/read (defined at /content/stylegan-encoder/encoder/generator_model.py:15) was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0, /job:localhost/replica:0/task:0/device:XLA_CPU:0, /job:localhost/replica:0/task:0/device:XLA_GPU:0 ]. Make sure the device specification refers to a valid device.
[[learnable_dlatents/read]]

Any suggestions Please. Ty!

I am getting the same error in Colab. Were you able to fix the issue?

@Radeeswar
Copy link

Radeeswar commented Nov 21, 2019

I am getting the same error in Colab. Were you able to fix the issue?

No. It seems like problem with colab GPU. It's working in other GPU by installing tenforflow-gpu==1.14 at start without importing any libraries.

I hope it helps.

@mr555ru
Copy link

mr555ru commented Dec 1, 2019

Seems working for me with tensorflow-gpu==1.14 in Colab GPU runtime.

@oyvindhg
Copy link

oyvindhg commented Feb 11, 2020

Seems working for me with tensorflow-gpu==1.14 in Colab GPU runtime.

Like Radeeswar and taniyaghosh29 I cannot make it work in Colab either. Did you do anything extra to make it work in Colab with tensorflow-gpu==1.14?

Edit: Made it work. My error was to use tensorflow==1.14, instead of tensorflow-gpu==1.14

@danielkaifeng
Copy link

danielkaifeng commented Mar 25, 2020

I remove all tensorflow pkg and do pip3 install tensorflow-gpu==1.14 --user
this problem still exists.

I add allow_soft_placement to gpu config and didn't solve this problem.

@olivercoad olivercoad linked a pull request Mar 29, 2020 that will close this issue
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

Successfully merging a pull request may close this issue.

7 participants