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

"ValueError: max() arg is an empty sequence" when trying to run via jupyterlab env #37

Open
bstnhnsl opened this issue Nov 19, 2023 · 1 comment

Comments

@bstnhnsl
Copy link

I'm trying to tokenflow via jupyterlab env.

On the last step, when running run_tokenflow_pnp.py, I get this error:

Traceback (most recent call last):
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 301, in <module>
    run(config)
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 280, in run
    editor = TokenFlow(config)
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 62, in __init__
    self.paths, self.frames, self.latents, self.eps = self.get_data()
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 183, in get_data
    eps = self.get_ddim_eps(latents, range(self.config["n_frames"])).to(torch.float16).to(self.device)
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 187, in get_ddim_eps
    noisest = max([int(x.split('_')[-1].split('.')[0]) for x in glob.glob(os.path.join(self.latents_path, f'noisy_latents_*.pt'))])
ValueError: max() arg is an empty sequence
@Zeldalina
Copy link

I'm trying to tokenflow via jupyterlab env.

On the last step, when running run_tokenflow_pnp.py, I get this error:

Traceback (most recent call last):
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 301, in <module>
    run(config)
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 280, in run
    editor = TokenFlow(config)
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 62, in __init__
    self.paths, self.frames, self.latents, self.eps = self.get_data()
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 183, in get_data
    eps = self.get_ddim_eps(latents, range(self.config["n_frames"])).to(torch.float16).to(self.device)
  File "/home/jovyan/token-flow/run_tokenflow_pnp.py", line 187, in get_ddim_eps
    noisest = max([int(x.split('_')[-1].split('.')[0]) for x in glob.glob(os.path.join(self.latents_path, f'noisy_latents_*.pt'))])
ValueError: max() arg is an empty sequence

因为你没有先执行preprocess.py代码,导致路径os.path.join(self.latents_path, f'noisy_latents_*.pt')上的文件不存在。你应该先执行preprocess.py代码,再执行run_tokenflow_pnp.py。

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

2 participants