pytti-tools / pytti-core

https://pytti-tools.github.io/pytti-book/intro.html
MIT License
79 stars 23 forks source link

user shouldn't be responsible for setting the `backups` parameter #75

Open psx2 opened 2 years ago

psx2 commented 2 years ago

Hi there,

I installed the software as instructed on this guide: https://pytti-tools.github.io/pytti-book/intro.html

Using the CLI command python -m pytti.workhorse conf=demo I get the following output after 18/30 iterations.

20

which produces this image

18

Any help would be appreciated! : )

dmarx commented 2 years ago

I think you might be using an older version of the code here. Try upgrading to the latest version, instructions here: https://pytti-tools.github.io/pytti-book/Setup.html#uninstalling-and-or-updating

(should take just like 3-5 minutes)

psx2 commented 2 years ago

No luck sadly, have tried an entirely fresh install too.

dmarx commented 2 years ago

can you generate a full stack trace and share it? set that environment variable HYDRA_FULL_ERROR=1 and share the output after reproducing the error. Also, please share your current settings (should have been spat out as one of the early log messages)

dmarx commented 2 years ago

are you still having issues with pytti?

TomSlezakowski commented 2 years ago

I have this exact same issue when trying to run locally on my Windows 10 machine from a totally fresh install;

2022-06-14 21:50:45.907 | DEBUG    | pytti.update_func:report_out:72 - Step 11 losses:
2022-06-14 21:50:45.909 | DEBUG    | pytti.update_func:report_out:75 - astrophotography #pixelart     0.829136
image credit nasa              0.884936
space full of cybern.. neon    0.884179
isometric pixelart b.. Teng    0.947758
deep space habitatio..glass    0.934373
galactic nebula                0.897885
wow! space is full o..flies    0.852038
satellite image                0.891937
text                           0.888900
anime                          0.930350
watermark                      0.876873
backyard telescope             0.923038
map                            0.932576
Name: 10, dtype: float64
<PIL.Image.Image image mode=RGB size=512x512 at 0x208ACC4B190>
 37%|██████████████████████████████████████████████▌                                                                                | 11/30 [00:06<00:12,  1.57it/s]

Error executing job with overrides: ['conf=demo']
Traceback (most recent call last):
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\pytti\workhorse.py", line 636, in <module>
    _main()
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\main.py", line 90, in decorated_main
    _run_hydra(
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\_internal\utils.py", line 389, in _run_hydra
    _run_app(
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\_internal\utils.py", line 452, in _run_app
    run_and_report(
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\_internal\utils.py", line 216, in run_and_report
    raise ex
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\_internal\utils.py", line 213, in run_and_report
    return func()
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\_internal\utils.py", line 453, in <lambda>
    lambda: hydra.run(
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\_internal\hydra.py", line 132, in run
    _ = ret.return_value
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\core\utils.py", line 260, in return_value
    raise self._return_value
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\hydra\core\utils.py", line 186, in run_job
    ret.return_value = task_function(task_cfg)
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\pytti\workhorse.py", line 624, in _main
    do_run()
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\pytti\workhorse.py", line 571, in do_run
    i += model.run_steps(
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\pytti\ImageGuide.py", line 170, in run_steps
    self.update(
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\pytti\update_func.py", line 175, in update
    save_out(
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\site-packages\pytti\update_func.py", line 145, in save_out
    subprocess.run(
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\tomsl\anaconda3\envs\pytti2\lib\subprocess.py", line 1420, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

Settings

2022-06-14 21:52:16.115 | DEBUG    | __main__:_main:209 - {'scenes': 'deep space habitation ring made of glass | galactic nebula | wow! space is full of fractal creatures darting around everywhere like fireflies', 'scene_prefix': 'astrophotography #pixelart | image credit nasa | space full of cybernetic neon:3_galactic nebula | isometric pixelart by Sachin Teng | ', 'scene_suffix': '| satellite image:-1:-.95 | text:-1:-.95 | anime:-1:-.95 | watermark:-1:-.95 | backyard telescope:-1:-.95 | map:-1:-.95', 'direct_image_prompts': '', 'init_image': '', 'direct_init_weight': '', 'semantic_init_weight': '', 'image_model': 'Limited Palette', 'vqgan_model': 'sflckr', 'animation_mode': '3D', 'width': 512, 'height': 512, 'steps_per_scene': 30, 'steps_per_frame': 3, 'interpolation_steps': 0, 'learning_rate': None, 'reset_lr_each_frame': True, 'seed': -4854551145582748953, 'cutouts': 40, 'cut_pow': 2, 'cutout_border': 0.25, 'border_mode': 'clamp', 'field_of_view': 60, 'near_plane': 1, 'far_plane': 10000, 'input_audio': '', 'input_audio_offset': 0, 'input_audio_filters': [], 'pre_animation_steps': 2, 'lock_camera': True, 'translate_x': '-1700*sin(radians(1.5))', 'translate_y': '0', 'translate_z_3d': '(50+10*t)*sin(t/10*pi)**2', 'rotate_3d': '[cos(radians(1.5)), 0, -sin(radians(1.5))/sqrt(2), sin(radians(1.5))/sqrt(2)]', 'rotate_2d': '0', 'zoom_x_2d': '0', 'zoom_y_2d': '0', 'sampling_mode': 'bicubic', 'infill_mode': 'wrap', 'pixel_size': 1, 'smoothing_weight': 0.02, 'random_initial_palette': False, 'palette_size': 5, 'palettes': 20, 'gamma': 1, 'hdr_weight': 0.01, 'palette_normalization_weight': 0.2, 'show_palette': False, 'target_palette': '', 'lock_palette': False, 'frames_per_second': 12, 'direct_stabilization_weight': '', 'semantic_stabilization_weight': '', 'depth_stabilization_weight': '', 'edge_stabilization_weight': '', 'flow_stabilization_weight': '', 'video_path': '', 'frame_stride': 1, 'reencode_each_frame': True, 'flow_long_term_samples': 1, 'ViTB32': True, 'ViTB16': False, 'ViTL14': False, 'ViTL14_336px': False, 'RN50': False, 'RN101': False, 'RN50x4': False, 'RN50x16': False, 'RN50x64': False, 'use_mmc': False, 'file_namespace': 'default', 'allow_overwrite': False, 'display_every': 3, 'clear_every': 0, 'display_scale': 1, 'save_every': 3, 'backups': 3, 'show_graphs': False, 'approximate_vram_usage': False, 'use_tensorboard': False, 'models_parent_dir': 'C:\\Users\\tomsl\\.cache', 'gradient_accumulation_steps': 1, 'device': 0}

The first four images seem to render correctly, but the job always fails before step 12.

Would love to get this working locally, as image generation seems a fair bit faster than through collab.

dmarx commented 2 years ago

ok, I totally see what the issue is now. As a temporary fix, you should be able to get around this by fiddling with the backups setting. Try setting that to 0 first: if you still get an error, try incrementing it higher starting at whatever it was previously set to when you go the error (e.g. if it was set to 5, try setting it to 6).

this setting frankly isn't something the user should be asked to set themselves. I'll try fixing this by having pytti-core compute a lower-bound for this setting, so users could set it higher than necessary if they want but never lower. I think that should fix it? we'll see.

TomSlezakowski commented 2 years ago

Thanks for the quick response, setting backups: 0 has it working now! & thanks for all the work on this in general, I'm only just scratching the surface, but a lot of fun and endless possibilities!

dmarx commented 2 years ago

glad to hear that fixed it! I changed a couple of the defaults a few days ago and that was one of em. I spent all day today wrestling with a really cryptic error that turned out to also be a consequence of the new defaults, so... whoops :/