azadis / MC-GAN

Multi-Content GAN for Few-Shot Font Style Transfer at CVPR 2018

Home Page:http://bair.berkeley.edu/blog/2018/03/13/mcgan/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AssertionError: not a valid directory

DanoDataScientist opened this issue · comments

commented

Hi, so I only mod'd the cGan file to run on a CPU rather than a GPU and I'm consistently running into this assertionError. I have followed the path manually to ensure it directs to the right location (it does) but somehow this error consistently throws even though the directory does exist. Could you take a peek at my code and ref. error code, I could use the help because I have been unable to correct this on my own using web references.
`#!/bin/bash -f

#=====================================

MC-GAN

Train and Test conditional GAN Glyph network

By Samaneh Azadi

#=====================================

#=====================================

Set Parameters

#=====================================

DATA=$1
DATASET="../datasets/${DATA}/"
experiment_dir="GlyphNet_pretrain"
MODEL=cGAN
MODEL_G=resnet_6blocks
MODEL_D=n_layers
n_layers_D=1
NORM=batch
IN_NC=26
O_NC=26
GRP=26
PRENET=2_layers
FINESIZE=64
LOADSIZE=64
LAM_A=100
NITER=500
NITERD=100
BATCHSIZE=150
CUDA_ID=-1

if [ ! -d "./checkpoints/${experiment_dir}" ]; then
mkdir "./checkpoints/${experiment_dir}"
fi
LOG="./checkpoints/${experiment_dir}/output.txt"
if [ -f $LOG ]; then
rm $LOG
fi

exec &> >(tee -a "$LOG")

=======================================

Train Glyph Network on font dataset

=======================================

python train.py --dataroot ../datasets --name "${experiment_dir}"
--model ${MODEL} --which_model_netG ${MODEL_G} --which_model_netD ${MODEL_D} --n_layers_D ${n_layers_D} --which_model_preNet ${PRENET}
--norm ${NORM} --input_nc ${IN_NC} --output_nc ${O_NC} --grps ${GRP} --fineSize ${FINESIZE} --loadSize ${LOADSIZE} --lambda_A ${LAM_A} --align_data --use_dropout
--display_id 0 --niter ${NITER} --niter_decay ${NITERD} --batchSize ${BATCHSIZE} --conditional --save_epoch_freq 100 --print_freq 100 --conv3d --gpu_ids ' '

=======================================

Train on RGB inputs to generate RGB outputs; Image Translation in the paper

=======================================

CUDA_VISIBLE_DEVICES=2 python ~/AdobeFontDropper/train.py --dataroot ../datasets/Capitals_colorGrad64/ --name "${experiment_dir}"\

					 # --model cGAN --which_model_netG resnet_6blocks --which_model_netD n_layers --n_layers_D 1 --which_model_preNet 2_layers \
					 # --norm batch --input_nc 78 --output_nc 78 --fineSize 64 --loadSize 64 --lambda_A 100 --align_data --use_dropout \
					 # --display_id 0 --niter 500 --niter_decay 1000 --batchSize 100 --conditional --save_epoch_freq 20 --display_freq 2 --rgb

=======================================

Consider input as tiling of input glyphs rather than a stack

=======================================

CUDA_VISIBLE_DEVICES=2 python ~/AdobeFontDropper/train.py --dataroot ../datasets/Capitals64/ --name "${experiment_dir}" \

			# --model cGAN --which_model_netG resnet_6blocks --which_model_netD n_layers  --n_layers_D 1 --which_model_preNet 2_layers\
			# --norm batch --input_nc 1 --output_nc 1 --fineSize 64 --loadSize 64 --lambda_A 100 --align_data --use_dropout\
			# --display_id 0 --niter 500 --niter_decay 2000 --batchSize 5 --conditional --save_epoch_freq 10 --display_freq 5 --print_freq 100 --flat

`
screen shot 2019-03-06 at 11 46 51 pm

commented

Soo...to answer my own question because it didn't strike me until I was reviewing my issue here. The "../datasets/train" was causing the error. It requires only "./datasets/train" not two ".", just wanted to post that so anyone who stumbles across this will now know the issue and solution. The code causing the error can be found under the "CUDA_VISIBLE_DEVICES" section under --dataroot