mikael-alafriz-deel / lucid-sonic-dreams

MIT License
771 stars 157 forks source link

Assertion Error when running hallucinate() #13

Open fmaschhur opened 3 years ago

fmaschhur commented 3 years ago

When running hallucinate() i get the following error:

L.hallucinate('test.mp4', speed_fpm=24, motion_randomness=0.8, resolution=120)
Preparing style...
Setting up TensorFlow plugin "fused_bias_act.cu": Failed!
Preparing audio...
Loading effects...

Doing math...

Hallucinating... 

  0%|                                                                                                                                                                              | 0/5470 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/test/lsdvenv/lib/python3.7/site-packages/lucidsonicdreams/main.py", line 680, in hallucinate
    self.generate_frames()
  File "/Users/test/lsdvenv/lib/python3.7/site-packages/lucidsonicdreams/main.py", line 525, in generate_frames
    np.tile(class_batch, (batch_size, 1)))
  File "/Users/test/stylegan2/dnnlib/tflib/network.py", line 604, in run
    out_gpu = net_gpu.get_output_for(*in_gpu, return_as_list=True, **dynamic_kwargs)
  File "/Users/test/stylegan2/dnnlib/tflib/network.py", line 350, in get_output_for
    self._get_vars()  # ensure that all variables have been created
  File "/Users/test/stylegan2/dnnlib/tflib/network.py", line 297, in _get_vars
    self._vars = OrderedDict(self._get_own_vars())
  File "/Users/test/stylegan2/dnnlib/tflib/network.py", line 286, in _get_own_vars
    self._init_graph()
  File "/Users/test/stylegan2/dnnlib/tflib/network.py", line 126, in _init_graph
    assert self._input_templates is None
AssertionError
>>> 

I'm on Big Sur.

julienbeisel commented 3 years ago

I have the same issue on Windows with a pre-trained network.

I looked at the StyleGAN code and I can't tell why it's happening...

julienbeisel commented 3 years ago

@fmaschhur For some reason the same code works on Google Collab. I think it has something to do with TensorFlow installation or other ones (C++ for example), I will check it on my personal computer later.

fmaschhur commented 3 years ago

@julienbeisel yes, I made the same experience, it seems to be working fine on Google Collab.

Maybe the dockerization of the whole app works?

julienbeisel commented 3 years ago

Yes I think it works (see open PR for example) but I think it has something to do with how the script is packaged. I think I will fork it and work a bit on it, I can't use it in a .venv so I'll probably try to use it differently :)

PhilippMueller24 commented 2 years ago

Did you get it running? I am having the same issue.. It works in the colab but not on my local machine in neither a python 3.6 nor 3.7 environment. The first error: "Setting up TensorFlow plugin "fused_bias_act.cu": Failed!" can be fixed like this: https://github.com/NVlabs/stylegan2-ada/issues/91

@fmaschhur a docker container would indeed be a great choice for this package! :)

jomynow commented 1 year ago

@PhilippMueller24 I had no issues in Google Collab but I've learned a lot setting up these environments haha.

Has anyone gotten this to work on a local computer? I'm getting more familiar with Anaconda.

fmaschhur commented 1 year ago

Has anyone gotten this to work on a local computer?

Sadly, no. It has only ever worked for me with Colab.

deeplearn-art commented 1 year ago

Now got this on Colab

jomynow commented 1 year ago

I figured it out on linux it required Anaconda, an nvidia drivers, cuda driversGPU and the exact specific libraries. Then there are a couple of other pain points where we have to download specific files and path permissions.

On Mon, Oct 17, 2022 at 4:11 PM deeplearn-art @.***> wrote:

Now got this on Colab

— Reply to this email directly, view it on GitHub https://github.com/mikaelalafriz/lucid-sonic-dreams/issues/13#issuecomment-1281429767, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALAIYDEYFRQB6IOKGDZNN23WDWXGLANCNFSM4ZKSZV2A . You are receiving this because you commented.Message ID: @.***>