JCBrouwer/maua-style

No such file or directory: '../pytorch-unflow//network-css.pytorch

gateway opened this issue · 2 comments

Trying to run the code and its erroring out on this..

(maua) gateway@gateway-media:~/work/video/maua-style$ python canvas.py -content rory.mp4 -style /home/work/styles/tre.jpg -output test -gpu 0 -backend cudnn -cudnn_autotune -model_file /home/gateway/vgg19-d01eb7cb.pth
/home/gateway/work/video/maua-style/config.py:115: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  cfg_special = yaml.load(f)
output_dir:                   /home/hans/neurout/maua-style 
transfer_type:                vid_img                       
input:
	content:                      rory.mp4                      
	style:                        /home/work/styles/tre.jpg     
	init:                         content                       
	seed:                         -1                            
param:
	num_scales:                   2                             
	passes_per_scale:             4                             
	image_sizes:                  256,384,512,600,724,850,1024  
	size_scaling:                 power                         
	num_iterations:               800,700,600,500,400,300,200   
	iter_scaling:                 power                         
	content_weight:               500                           
	temporal_weight:              15000                         
	blend_weight:                 0.25                          
	style_weight:                 50000                         
	style_blend_weights:          False                         
	style_scale:                  1.0                           
	tv_weight:                    0.0001                        
	original_colors:              False                         
	normalize_weights:            False                         
	use_covariance:               False                         
model:
	model_file:                   /home/gateway/vgg19-d01eb7cb.pth
	disable_check:                False                         
	pooling:                      max                           
	content_layers:               relu4_2                       
	style_layers:                 relu1_1,relu2_1,relu3_1,relu4_1,relu5_1
	gpu:                          0                             
	backend:                      cudnn                         
	cudnn_autotune:               True                          
	multidevice_strategy:         7                             
	dtype:                        <class 'torch.cuda.FloatTensor'>
	multidevice:                  False                         
	backward_device:              cuda:0                        
optim:
	optimizer:                    lbfgs                         
	lbfgs_num_correction:         100                           
	learning_rate:                1                             
	print_iter:                   0                             
	save_iter:                    0                             
flow:
	model_gpu:                    unflow                        
	model_type_gpu:               css                           
	model_dir_gpu:                ../pytorch-unflow/            
	model_cpu:                    deepflow2                     
	model_type_cpu:               sintel                        
ffmpeg:
	framerate:                    10                            
	vcodec:                       hevc_nvenc                    
	c:v:                          hevc_nvenc                    
	preset:                       slow                          
	b:v:                          20M                           
output:                       test                          


Traceback (most recent call last):
  File "canvas.py", line 337, in <module>
    vid_img(opt)
  File "canvas.py", line 202, in vid_img
    flow_model = get_flow_model(opt)
  File "canvas.py", line 102, in get_flow_model
    model = unflow.UnFlow(opt.flow).cuda().eval()
  File "/home/gateway/work/video/maua-style/unflow.py", line 231, in __init__
    self.load_state_dict(torch.load(opt.model_dir_gpu + "/network-" + opt.model_type_gpu + ".pytorch"))
  File "/home/gateway/anaconda3/envs/maua/lib/python3.7/site-packages/torch/serialization.py", line 382, in load
    f = open(f, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '../pytorch-unflow//network-css.pytorch'

this is my command line currently based upon what I could gather from the settings.

python canvas.py -content rory.mp4 -style /home/work/styles/tre.jpg -output test -gpu 0 -backend cudnn -cudnn_autotune -model_file /home/gateway/vgg19-d01eb7cb.pth

thoughts?

Ahh you'll need to clone https://github.com/sniklaus/pytorch-unflow into the same directory you've cloned this repo in. Then download the pretrained models with the script in there.

Sorry the repo isn't really in a clean state with documentation/instructions etc.
It's on my todo list to clean this up to make it easy to use.

If you feel like it you can add things to the install.sh or README once you've got things working

Use

git clone --recursive https://github.com/JCBrouwer/maua-style.git

(if not cloned yet) or

git submodule update --init --recursive

(if already cloned) to update the missing submodule issues.