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

vgg16.npy instead of vgg16.pkl #2

Open
ksd777 opened this issue Aug 7, 2018 · 4 comments
Open

vgg16.npy instead of vgg16.pkl #2

ksd777 opened this issue Aug 7, 2018 · 4 comments

Comments

@ksd777
Copy link

ksd777 commented Aug 7, 2018

Hello,
Do you have an updated training.py file where you demonstrate how to correctly load and use parameters from npy pretrained file? Or maybe you can provide path to download vgg16.pkl?

@ksd777 ksd777 changed the title vgg16.npy instead of vgg16.pkli vgg16.npy instead of vgg16.pkl Aug 7, 2018
@ccny-ros-pkg
Copy link
Collaborator

Please check demo:
with np.load('/home/robolab/project/deepProjectBridge/YL_50iterV2.npz') as f:
param_values = [f['arr_%d' % i] for i in range(len(f.files))]
lasagne.layers.set_all_param_values(output_layer, param_values)

Just use this one to load the pre-trained the model.

In order to train, in the training.py, please comment this line:

Load model weights and metadata

d = pickle.load(open('vgg16.pkl'))

Then everything should work

@ksd777
Copy link
Author

ksd777 commented Aug 8, 2018

Ok, thanks!
There were necessary to these lines to the build_model function:
net['fc7_2048'] = DenseLayer(net['fc6'], num_units=2048)
net['fc8_7'] = DenseLayer(net['fc7_2048'], num_units=2, nonlinearity=None)
net['prob'] = NonlinearityLayer(net['fc8_7'], softmax)

#net['prob'] = NonlinearityLayer(net['fc8'], softmax)

Also, there are three broken image files into the training list:
spallSubImageForTraining/imageClustersV130B130/accepted/accept186007.jpg
spallSubImageForTraining/imageClustersV130B130/accepted/accept186008.jpg
spallSubImageForTraining/imageClustersV130B130/accepted/accept186009.jpg

Also could you please let me know what parameters I have to use in demo.py to reproduce your result on example image?
i.e. I found out that with regionSize=25 result is following:
232
regionSize=55 gives:
232
the original 200 gives:
232
Also the result does not seem to be stable - it is easy to get different result with the same parameters.

My console output from demo.py:

Using gpu device 0: GeForce GTX 1080 (CNMeM is disabled, cuDNN 5005)
/usr/local/lib/python2.7/dist-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
"downsample module has been moved to the theano.tensor.signal.pool module.")
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]
32
successfully..., from new model 500
direct testing

@ccny-ros-pkg
Copy link
Collaborator

Please try 60 or 50, also, for egionSize=55, it looks really weird. I will update a repeatable version using pytorch lately and let your know.

@ccny-ros-pkg
Copy link
Collaborator

Please check the updated pytorch version, it should be much easier for you. https://github.com/ccny-ros-pkg/pytorch_Concrete_Inspection.git

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