lucidrains / deep-daze

Simple command line tool for text to image generation using OpenAI's CLIP and Siren (Implicit neural representation network). Technique was originally created by https://twitter.com/advadnoun
MIT License
4.37k stars 326 forks source link

It works, but not well #169

Open MasonMillar opened 3 years ago

MasonMillar commented 3 years ago

C:\Windows\system32>imagine "ronald reagan" --image_width=256 --num_layers=24 --batch_size=1 Setting jit to False because torch version is not 1.7.1. Starting up... Imagining "ronald_reagan" from the depths of my weights... image updated at "./ronald_reagan.jpg" image updated at "./ronald_reagan.000001.jpg" image updated at "./ronald_reagan.000002.jpg" loss: -31.82: 29%|████████████████████████████████████████████ | 300/1050 [35:54<1:29:45, 7.18s/it] epochs: 0%| | 0/20 [35:54<?, ?it/s] Traceback (most recent call last): File "c:\users\mason\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\mason\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Mason\AppData\Local\Programs\Python\Python39\Scripts\imagine.exe__main__.py", line 7, in File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\deep_daze\cli.py", line 151, in main fire.Fire(train) File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\fire\core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\fire\core.py", line 466, in _Fire component, remaining_args = _CallAndUpdateTrace( File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\fire\core.py", line 681, in _CallAndUpdateTrace component = fn(*varargs, kwargs) File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\deep_daze\cli.py", line 147, in train imagine() File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\torch\nn\modules\module.py", line 1051, in _call_impl return forward_call(*input, *kwargs) File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\deep_daze\deepdaze.py", line 584, in forward , loss = self.train_step(epoch, i) File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\deep_daze\deep_daze.py", line 515, in train_step self.save_image(epoch, iteration, img=out) File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context return func(args, kwargs) File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\deep_daze\deep_daze.py", line 534, in save_image pil_img.save(f"{self.textpath}.jpg", quality=95, subsampling=0) File "c:\users\mason\appdata\local\programs\python\python39\lib\site-packages\PIL\Image.py", line 2232, in save fp = builtins.open(filename, "w+b") OSError: [Errno 22] Invalid argument: 'ronald_reagan.jpg'

iamtrippyy commented 3 years ago

having the same thing, did u find a fix?

CarpeNecopinum commented 3 years ago

@MasonMillar

C:\Windows\system32>

Afaik, the tool generates the image files into the folder you run it in... unless you're in an admin-shell, you won't be able to save the generated images to the system32 folder. (Don't actually run it as admin though, just use cd to navigate to the My Pictures of your current user and it should work just fine).

iamtrippyy commented 3 years ago

my problem was i had the photo open and it couldnt update it while it was open