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

issue while installing #91

Closed
nonvegetarian opened this issue Nov 5, 2023 · 18 comments
Closed

issue while installing #91

nonvegetarian opened this issue Nov 5, 2023 · 18 comments

Comments

@nonvegetarian
Copy link

(base) C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main>conda env create -f ./environment/dualstylegan_env.yaml
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • libedit==3.1.20191231=he28a2e2_2
  • libffi==3.2.1=he1b5a44_1007
  • setuptools==49.6.0=py38h578d9bd_3
  • matplotlib-base==3.3.4=py38h62a2d02_0
  • libfaiss==1.7.1=hb573701_0_cpu
  • certifi==2021.10.8=py38h06a4308_2
  • ca-certificates==2022.2.1=h06a4308_0
  • libgcc-ng==9.3.0=h2828fa1_19
  • pillow==8.3.1=py38h2c7a002_0
  • libstdcxx-ng==9.3.0=h6de172a_19
  • python-lmdb==1.2.1=py38h2531618_1
  • _libgcc_mutex==0.1=conda_forge
  • scikit-image==0.18.1=py38ha9443f7_0
  • python==3.8.3=cpython_he5300dc_0
  • faiss==1.7.1=py38h7b17aaf_0_cpu
@williamyang1991
Copy link
Owner

You may refer to williamyang1991/VToonify#50 (comment) and williamyang1991/VToonify#38 for solution.
And you may refer to https://github.com/williamyang1991/VToonify/tree/main/model/stylegan/op_cpu#readme if you cannot install something like fused

@nonvegetarian
Copy link
Author

facing this error now -

(vtoon_env) C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main>python style_transfer.py --scale_image
No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3'
Traceback (most recent call last):
File "C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main\style_transfer.py", line 4, in
from util import save_image, load_image
File "C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main\util.py", line 10, in
from model.stylegan.op import conv2d_gradfix
File "C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main\model\stylegan\op_init_.py", line 1, in
from .fused_act import FusedLeakyReLU, fused_leaky_relu
File "C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main\model\stylegan\op\fused_act.py", line 11, in
fused = load(
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\utils\cpp_extension.py", line 1308, in load
return _jit_compile(
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\utils\cpp_extension.py", line 1710, in _jit_compile
_write_ninja_file_and_build_library(
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\utils\cpp_extension.py", line 1810, in _write_ninja_file_and_build_library
_write_ninja_file_to_build_library(
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\utils\cpp_extension.py", line 2199, in _write_ninja_file_to_build_library
cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags()
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\utils\cpp_extension.py", line 1980, in _get_cuda_arch_flags
arch_list[-1] += '+PTX'
IndexError: list index out of range

@williamyang1991
Copy link
Owner

You error is about fused

File "C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main\model\stylegan\op\fused_act.py", line 11, in
fused = load(

And my previous answer

And you may refer to https://github.com/williamyang1991/VToonify/tree/main/model/stylegan/op_cpu#readme if you cannot install something like fused

So, please refer to my previous answer

@nonvegetarian
Copy link
Author

Thankyou, encountering this error now -

(vtoon_env) C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main>python style_transfer.py --scale_image
usage: style_transfer.py [-h] [--content CONTENT] [--style STYLE] [--style_id STYLE_ID] [--truncation TRUNCATION]
[--weight WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT WEIGHT]
[--name NAME] [--preserve_color] [--model_path MODEL_PATH] [--model_name MODEL_NAME]
[--output_path OUTPUT_PATH] [--data_path DATA_PATH] [--align_face]
[--exstyle_name EXSTYLE_NAME] [--wplus]
style_transfer.py: error: unrecognized arguments: --scale_image

@nonvegetarian
Copy link
Author

And this error after I remove "--scale_image" -

(vtoon_env) C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main>python style_transfer.py
Load options
align_face: False
content: ./data/content/081680.jpg
data_path: ./data/
exstyle_name: exstyle_code.npy
model_name: generator.pt
model_path: ./checkpoint/
name: cartoon_transfer
output_path: ./output/
preserve_color: False
style: cartoon
style_id: 53
truncation: 0.75
weight: [0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
wplus: False


Traceback (most recent call last):
File "C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main\style_transfer.py", line 75, in
ckpt = torch.load(os.path.join(args.model_path, args.style, args.model_name), map_location=lambda storage, loc: storage)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\serialization.py", line 986, in load
with _open_file_like(f, 'rb') as opened_file:
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\serialization.py", line 435, in _open_file_like
return _open_file(name_or_buffer, mode)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\serialization.py", line 416, in init
super().init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './checkpoint/cartoon\generator.pt'

@williamyang1991
Copy link
Owner

I believe you need to carefully read the README.md before running the code.

No option of --scale_image but align_face
image

Manually download the pretrained model
image

@nonvegetarian
Copy link
Author

Thankyou, but there seems to be an issue-

(vtoon_env) C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main>python style_transfer.py --content ./data/content/unsplash-rDEOVtE7vOs.jpg --align_face --preserve_color
Load options
align_face: True
content: ./data/content/unsplash-rDEOVtE7vOs.jpg
data_path: ./data/
exstyle_name: exstyle_code.npy
model_name: generator.pt
model_path: ./checkpoint/
name: cartoon_transfer
output_path: ./output/
preserve_color: True
style: cartoon
style_id: 53
truncation: 0.75
weight: [0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
wplus: False


Traceback (most recent call last):
File "C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main\style_transfer.py", line 75, in
ckpt = torch.load(os.path.join(args.model_path, args.style, args.model_name), map_location=lambda storage, loc: storage)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\serialization.py", line 986, in load
with _open_file_like(f, 'rb') as opened_file:
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\serialization.py", line 435, in _open_file_like
return _open_file(name_or_buffer, mode)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\serialization.py", line 416, in init
super().init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './checkpoint/cartoon\generator.pt'

@williamyang1991
Copy link
Owner

Manually download the pretrained model

Please read my answer carefully. Download the missing pretrained model and save it to './checkpoint/cartoon\generator.pt'

https://github.com/williamyang1991/DualStyleGAN#pretrained-models

@nonvegetarian
Copy link
Author

I don't have a cartoon folder inside the checkpoint folder. I just have one readme file in my checkpoint folder

@nonvegetarian
Copy link
Author

I have downloaded the generator.pt but, where do I save it?

can you please help me with this bit?

I have nothing but readme.md file in my checkpoint folder

@williamyang1991
Copy link
Owner

Please read my answer carefully. Download the missing pretrained model and save it to './checkpoint/cartoon\generator.pt'

create a new folder named cartoon and save it to './checkpoint/cartoon/generator.pt

@nonvegetarian
Copy link
Author

Should I also download the rest of the files ("refined_exstyle_code.npy", "sampler.pt", "instyle_code.npy", "finetune000600.pt", "exstyle_code.npy") from the drive for cartoon pretrained model and save them in the "cartoon" folder inside the checkpoint?

@williamyang1991
Copy link
Owner

To avoid similar issues, you'd better download them all

@nonvegetarian
Copy link
Author

Now it says - "Torch not compiled with CUDA enabled"

(vtoon_env) C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main>python style_transfer.py --content ./data/content/unsplash-rDEOVtE7vOs.jpg --align_face --preserve_color
Load options
align_face: True
content: ./data/content/unsplash-rDEOVtE7vOs.jpg
data_path: ./data/
exstyle_name: refined_exstyle_code.npy
model_name: generator.pt
model_path: ./checkpoint/
name: cartoon_transfer
output_path: ./output/
preserve_color: True
style: cartoon
style_id: 53
truncation: 0.75
weight: [0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 0.75, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
wplus: False


Traceback (most recent call last):
File "C:\Users\ruthv\Downloads\DualStyleGAN-main\DualStyleGAN-main\style_transfer.py", line 77, in
generator = generator.to(device)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\nn\modules\module.py", line 1160, in to
return self._apply(convert)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\nn\modules\module.py", line 810, in _apply
module._apply(fn)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\nn\modules\module.py", line 810, in _apply
module._apply(fn)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\nn\modules\module.py", line 833, in apply
param_applied = fn(param)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\nn\modules\module.py", line 1158, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File "C:\Users\ruthv\anaconda3\envs\vtoon_env\lib\site-packages\torch\cuda_init
.py", line 289, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

@williamyang1991
Copy link
Owner

If you are brand-new to pytorch and running deep learning models, I suggest you to use the huggingface demo rather than asking me.

@nonvegetarian
Copy link
Author

Thanks, but I would like to execute and try it out for myself and learn through...Can you help me?

@nonvegetarian
Copy link
Author

I have used -

pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

to install pytorch compiled with my CUDA version now, I'll update you when it is done

@williamyang1991
Copy link
Owner

I'm sorry I'm very busy and have no time to help you with these basic installation issues.
Your issues are basically not about the bug of my code, but the lack of your experience in building environment and running deep learning models. All these issues can find solutions on the Internet.
I think the best way is to search the solution on Google rather than asking me everytime you find an error..

I will close this issue and not answer your questions in this issue.
If you find bugs of the code rather than these basic installation issues, you can raise a new issue.

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