You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in model.py, line 19:
old code: self.resnet = resnet18(pretrained=True)
new code: self.resnet = resnet18(weights='ResNet18_Weights.DEFAULT')
in invert.py, line 19:
old code: perceptual = torchvision.models.vgg16(pretrained=True)
new code: perceptual = torchvision.models.vgg16(weights='VGG16_Weights.DEFAULT')
And your code not Windows compatible. Need install Visual Studio Community edition and add PATH this line (where have cl.exe):
for Windows x64: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x64
for Windows x86: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x86
I then created a testimages folder with an in and an out subfolder. I put in a JPG image and ran the test. This is what I got: J:\StyleCariGAN-master>test.py --ckpt checkpoint\StyleCariGAN\001000.pt --input_dir testimages\in --output_dir testimages\out --invert_images optimizing w optimizing w: loss_pixel: 0.4483; loss_feature: 4.0835: 100%|█| 250/250 [00:23< optimizing wp optimizing wp: loss_pixel: 0.2393; loss_feature: 2.2942: 100%|█| 2000/2000 [04: Traceback (most recent call last): File "J:\StyleCariGAN-master\test.py", line 120, in <module> invert(g_ema.photo_generator, perceptual, photo, device, args) File "J:\StyleCariGAN-master\invert.py", line 341, in invert torch.save(result, args.result_dir + f'/{args.image_name}.pt') File "C:\Users\Mykee\miniconda3\lib\site-packages\torch\serialization.py", line 376, in save with _open_file_like(f, 'wb') as opened_file: File "C:\Users\Mykee\miniconda3\lib\site-packages\torch\serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "C:\Users\Mykee\miniconda3\lib\site-packages\torch\serialization.py", line 211, in __init__ super(_open_file, self).__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'testimages\\in/testimages\\in\\20200913_124752.pt'
The .pt file(s) has not been generated or saved, so it cannot be found. How can I fix this?
The text was updated successfully, but these errors were encountered:
It seems that the path separator (delimiter) is differently defined according to the operating system (Windows: , Linux: /). Please check the path separator carefully. :-)
Hello,
Your code need updat here:
in model.py, line 19:
old code:
self.resnet = resnet18(pretrained=True)
new code:
self.resnet = resnet18(weights='ResNet18_Weights.DEFAULT')
in invert.py, line 19:
old code:
perceptual = torchvision.models.vgg16(pretrained=True)
new code:
perceptual = torchvision.models.vgg16(weights='VGG16_Weights.DEFAULT')
And your code not Windows compatible. Need install Visual Studio Community edition and add PATH this line (where have cl.exe):
I then created a testimages folder with an in and an out subfolder. I put in a JPG image and ran the test. This is what I got:
J:\StyleCariGAN-master>test.py --ckpt checkpoint\StyleCariGAN\001000.pt --input_dir testimages\in --output_dir testimages\out --invert_images optimizing w optimizing w: loss_pixel: 0.4483; loss_feature: 4.0835: 100%|█| 250/250 [00:23< optimizing wp optimizing wp: loss_pixel: 0.2393; loss_feature: 2.2942: 100%|█| 2000/2000 [04: Traceback (most recent call last): File "J:\StyleCariGAN-master\test.py", line 120, in <module> invert(g_ema.photo_generator, perceptual, photo, device, args) File "J:\StyleCariGAN-master\invert.py", line 341, in invert torch.save(result, args.result_dir + f'/{args.image_name}.pt') File "C:\Users\Mykee\miniconda3\lib\site-packages\torch\serialization.py", line 376, in save with _open_file_like(f, 'wb') as opened_file: File "C:\Users\Mykee\miniconda3\lib\site-packages\torch\serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "C:\Users\Mykee\miniconda3\lib\site-packages\torch\serialization.py", line 211, in __init__ super(_open_file, self).__init__(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: 'testimages\\in/testimages\\in\\20200913_124752.pt'
The .pt file(s) has not been generated or saved, so it cannot be found. How can I fix this?
The text was updated successfully, but these errors were encountered: