Open alehander92 opened 8 years ago
This may not help in your case, but I would not use adam with nin-imagenet as my first choice. Nin-imagenet appears more difficult to get to converge and l-bfgs is definitely better in that.
I am downloading the VGG 19 layers one now, I just wondered if that's a sign that something else on my system is not ok(or a bug)
You can use l-bfgs with nin-imagenet, just leave out -optimizer adam.
But there is probably something wrong in your setup. Running the same I get the following. Are you sure you have the correct model? Md5sum gives 8fbacb8dd696607876386e34ff68a84a models/nin_imagenet_conv.caffemodel
th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg -output_image profile.png -model_file models/nin_imagenet_conv.caffemodel -proto_file models/train_val.prototxt -num_iterations 1000 -seed 123 -content_layers relu0,relu3,relu7,relu12 -style_layers relu0,relu3,relu7,relu12 -content_weight 10 -style_weight 1000 -image_size 256 -optimizer adam -gpu -1 -tv_weight 0
Successfully loaded models/nin_imagenet_conv.caffemodel
MODULE data UNDEFINED
warning: module 'data [type 5]' not found
conv1: 96 3 11 11
cccp1: 96 96 1 1
cccp2: 96 96 1 1
conv2: 256 96 5 5
cccp3: 256 256 1 1
cccp4: 256 256 1 1
conv3: 384 256 3 3
cccp5: 384 384 1 1
cccp6: 384 384 1 1
conv4-1024: 1024 384 3 3
cccp7-1024: 1024 1024 1 1
cccp8-1024: 1000 1024 1 1
Setting up content layer 2 : relu0
Setting up style layer 2 : relu0
Setting up content layer 9 : relu3
Setting up style layer 9 : relu3
Setting up content layer 16 : relu7
Setting up style layer 16 : relu7
Setting up content layer 28 : relu12
Setting up style layer 28 : relu12
Running optimization with ADAM
Iteration 50 / 1000
Content 1 loss: 116326.865234
Content 2 loss: 364734.375000
Content 3 loss: 197101.347656
Content 4 loss: 1452.863007
Style 1 loss: 139646.621704
Style 2 loss: 172335.678101
Style 3 loss: 99164.207458
Style 4 loss: 3.526320
Total loss: 1090765.484481
I guess so, but the error persists.
-tv_weight 0
=> error
(-tv_weight default) =>
adam
=> loss 0, gray image
l-bfgs
=> actually nothing happens, exits immediately aft
Running optimization with L-BFGS
<optim.lbfgs> creating recyclable direction/step/history buffers
<optim.lbfgs> function value changing less than tolX ```
Nin-imagenet-conv may be a bit difficult to get started with some inputs. Usually it helps to try again a couple of times (with random seed). Leave out the -seed parameter and try again a few times.
On the other hand, on my computer it starts ok with your parameters including -seed 123 so something else is now different in your setup.
Check the model file with md5sum and compare with mine in my previous comment.
Install my pull request #97 and it will fix "function value changing less than tolX" error. Note that when I submitted it it was free of conflicts but does not appear to be the case anymore.
Hey, I am trying to run the example on Ubuntu, only CPU with
I am using
-tv_weight
because otherwise it's producing only gray images with loss 0 and I saw 149I am getting