lucidrains/deep-daze

It works, but not well

MasonMillar opened this issue · 3 comments

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\deep_daze.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'

having the same thing, did u find a fix?

@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).

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