stargan-v2 icon indicating copy to clipboard operation
stargan-v2 copied to clipboard

Needs help!

Open kchen3 opened this issue 4 years ago • 10 comments

Hi,

First, it's a great project, and thank you for sharing the documents and codes. However, I have encountered two issues listed below. Thanks again for your help in advance!

  1. x264 cannot be installed? (stargan-v2) C:\Users\xxx\stargan-v2>conda install x264=='1!152.20180717' ffmpeg=4.0.2 -c conda-forge

CondaValueError: invalid package specification: x264=='1152.20180717

  1. When running the script in CMD in windows 10, the error shows as below:

python main.py --mode sample --num_domains 2 --resume_iter 100000 --w_hpf 1 --checkpoint_dir expr/checkpoints/celeba_hq --result_dir expr/results/celeba_hq --src_dir assets/representative/celeba_hq/src --ref_dir assets/representative/celeba_hq/ref

Error message: Traceback (most recent call last): File "main.py", line 182, in main(args) File "main.py", line 37, in main solver = Solver(args) File "C:\Users\xxx\stargan-v2\core\solver.py", line 58, in init self.ckptios = [CheckpointIO(ospj(args.checkpoint_dir, '{:06d}_nets_ema.ckpt'), **self.nets_ema)] File "C:\Users\xxx\stargan-v2\core\checkpoint.py", line 17, in init os.makedirs(os.path.dirname(fname_template), exist_ok=True) File "C:\Users\xxx.conda\envs\stargan-v2\lib\os.py", line 220, in makedirs mkdir(name, mode) FileNotFoundError: [WinError 3] The system cannot find the path specified: '{:'

kchen3 avatar May 03 '20 21:05 kchen3

We don't have an answer for Q1. We tested our code on linux only. Maybe someone else with windows experience could provide some help here.

Q2 is resolved in #3 . Hope it helps.

youngjung avatar May 06 '20 02:05 youngjung

Getting the same issue in Windows 10 CMD Error message: Traceback (most recent call last): File "main.py", line 182, in main(args) File "main.py", line 37, in main solver = Solver(args) File "C:\Users\xxx\stargan-v2\core\solver.py", line 58, in init self.ckptios = [CheckpointIO(ospj(args.checkpoint_dir, '{:06d}_nets_ema.ckpt'), **self.nets_ema)] File "C:\Users\xxx\stargan-v2\core\checkpoint.py", line 17, in init os.makedirs(os.path.dirname(fname_template), exist_ok=True) File "C:\Users\xxx.conda\envs\stargan-v2\lib\os.py", line 220, in makedirs mkdir(name, mode) FileNotFoundError: [WinError 3] The system cannot find the path specified: '{:'

iampranav-ai avatar May 18 '20 17:05 iampranav-ai

modify 58 line of solver.py to

self.ckptios = [CheckpointIO(ospj(args.checkpoint_dir, '100000_nets_ema.ckpt'), self.nets_ema)]

and modify init function of checkpoint.py

def init(self, fname_template, module_list): os.makedirs(os.path.dirname(fname_template), exist_ok=True) self.fname_template = fname_template self.module_dict = module_list

It's work at Windows

JacksonL1 avatar Jun 23 '20 11:06 JacksonL1

modify 58 line of solver.py to

self.ckptios = [CheckpointIO(ospj(args.checkpoint_dir, '100000_nets_ema.ckpt'), self.nets_ema)]

and modify init function of checkpoint.py

def init(self, fname_template, module_list): os.makedirs(os.path.dirname(fname_template), exist_ok=True) self.fname_template = fname_template self.module_dict = module_list

It's work at Windows

Why does this error appear when I run it in windows after I modified it as you said?

Traceback (most recent call last): File "main.py", line 21, in from core.solver import Solver File "E:\sxc\stargan-v2-master\core\solver.py", line 22, in from core.checkpoint import CheckpointIO File "E:\sxc\stargan-v2-master\core\checkpoint.py", line 15, in class CheckpointIO(object): File "E:\sxc\stargan-v2-master\core\checkpoint.py", line 24, in CheckpointIO self.fname_template = fname_template NameError: name 'fname_template' is not defined

(stargan-v2) E:\sxc\stargan-v2-master>python main.py --mode train --num_domains 1 --w_hpf 1 --lambda_reg 1 --lambda_sty 1 --lam bda_ds 1 --lambda_cyc 1 --train_img_dir data/airplane/train --val_img_dir data/airplane/val Traceback (most recent call last): File "main.py", line 21, in from core.solver import Solver File "E:\sxc\stargan-v2-master\core\solver.py", line 22, in from core.checkpoint import CheckpointIO File "E:\sxc\stargan-v2-master\core\checkpoint.py", line 15, in class CheckpointIO(object): File "E:\sxc\stargan-v2-master\core\checkpoint.py", line 24, in CheckpointIO self.fname_template = fname_template NameError: name 'fname_template' is not defined

(stargan-v2) E:\sxc\stargan-v2-master>python main.py --mode train --num_domains 1 --w_hpf 1 --lambda_reg 1 --lambda_sty 1 --lam bda_ds 1 --lambda_cyc 1 --train_img_dir data/airplane/train --val_img_dir data/airplane/val Traceback (most recent call last): File "main.py", line 21, in from core.solver import Solver File "E:\sxc\stargan-v2-master\core\solver.py", line 22, in from core.checkpoint import CheckpointIO File "E:\sxc\stargan-v2-master\core\checkpoint.py", line 15, in class CheckpointIO(object): File "E:\sxc\stargan-v2-master\core\checkpoint.py", line 24, in CheckpointIO self.fname_template = fname_template NameError: name 'fname_template' is not defined

xiaochuangshu avatar Dec 17 '21 03:12 xiaochuangshu

Q1: setup ffmpeg-4.4.1-essentials_build first, download from https://ffmpeg.org/download.html#build-windows; then pip install ffmpeg-python, not ffmpeg. this works for me.

study3h avatar Dec 21 '21 08:12 study3h

I tried your method. It passed the Q2, but brings a new problem: AttributeError: 'CheckpointIO' object has no attribute 'data_parallel'

TongfanWei avatar Feb 01 '22 00:02 TongfanWei

remove checkpoint.py line 17 checkpoint.py .And create expr in the root directory, and create checkpoints under expr.

jishulinbyte avatar Jul 06 '22 09:07 jishulinbyte

Hello, how to download the dataset in the Chinese mainland and in the window environment, I encountered some problems when downloading the dataset: download.sh: line 46: wget: command not found unzip: cannot find or open ./data/afhq.zip, ./data/afhq.zip.zip or ./data/afhq.zip.ZIP. rm: cannot remove './data/afhq.zip': No such file or directory

srx123456 avatar Sep 12 '22 14:09 srx123456

Replace all the '{:06d}' as '{06d}', it will work on Windows platform!

ZacHu-ZYH avatar May 06 '23 05:05 ZacHu-ZYH

modify 58 line of solver.py to

self.ckptios = [CheckpointIO(ospj(args.checkpoint_dir, '100000_nets_ema.ckpt'), self.nets_ema)]

and modify init function of checkpoint.py

def init(self, fname_template, module_list): os.makedirs(os.path.dirname(fname_template), exist_ok=True) self.fname_template = fname_template self.module_dict = module_list

It's work at Windows

I don't recommend doing this, because each saved model overwrites the last

ZacHu-ZYH avatar May 06 '23 05:05 ZacHu-ZYH