CCNYRoboticsLab / concreteIn_inpection_VGGF

Concrete Crack and Spalling Detection using Deep Neural Network
https://ericlyang.github.io/project/deepinspection/
71 stars 26 forks source link

vgg16.npy instead of vgg16.pkl #2

Open ksd777 opened 6 years ago

ksd777 commented 6 years ago

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?

ccny-ros-pkg commented 6 years ago

Please check demo: with np.load('/home/robolab/project/deepProjectBridge/YL_50iterV2.npz') as f: paramvalues = [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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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