I am trying to transfer LSTM weigts from Caffe to Tensorflow model, but I can't figure out ordering of LSTM weights in Caffe. I managed to export Caffe weights to numpy array.
Related
I have one image. I really want to transform/decode it to become a tensor. Why? Because I want to feed this tensor into my neural network written in keras. The question is, how do I transform this image into a tensor with values, that doesn't give me an error when feeding the neural net ?
So suppose there is a PATH, and this has to be changed into a TENSOR, which can be feed into the keras neural network.
Thank you, very much.
You can use Keras' ImageDataGenerator(), which generates batches of tensor image data. You can then call flow_from_directory() on your ImageDataGenerator() object, which takes a path to the directory where your images are, and generates batches of data from the images themselves. These two videos demonstrate this process with an example:
Image preparation for CNN training with Keras
Create and train a CNN with Keras
I'm trying to stack vgg16 and lstm layers. Any ideas how to it make it work?
Pss, LSTM requires time distributed over all other layers, which don't return sequences.
Thanks for considering my problem
I would like to use an existing VGG16 model trained on imagenet and fine-tune it with a custom dataset for some other classes required by me.
Where can I find the caffemodel, train_val.prototxt and solver.prototxt for the same ?
To fine-tune it with the custom dataset, is the procedure same as
Fine Tuning of GoogLeNet Model
A guide to convert_imageset.cpp
?
However, I want to use the newly-trained weights of the VGG16 model to train a faster RCNN (py-faster-rcnn) https://github.com/rbgirshick/py-faster-rcnn on a custom dataset.
For training faster RCNN on a custom dataset, I was planning on following the steps given here http://sgsai.blogspot.com/2016/02/training-faster-r-cnn-on-custom-dataset.html
Will the caffemodel generated from the VGG16 fine-tuning done earlier work here or some tweaks need to be done ?
I have build my own dataset for digit classification and it worked well with convolutional network model developed by lisa lab (Here). I wanted to visualize the weights and i wanted to do it through keras.
Keras documentation tries to load mnist data like this:
(X_train, y_train), (X_test, y_test) = mnist.load_data()
But i want my pickled dataset to load instead of mnist default data. Where does mnist module for keras load it's dataset ? And, how can i pass my own dataset instead of that to use mnist module from keras ?
Thanks in advance.
You can get a lot of info about this method by reading the source: https://github.com/fchollet/keras/blob/master/keras/datasets/mnist.py
In this case, the dataset is a pickle file loaded from an Amazon S3 bucket.
You could write a copy of this function and use it yourself to load up a different pickled dataset.
I am new to opencv. I want to use SVM in opencv. My question is can I train the classifier once and save all vectors. So in my main program I just need to import these vectors and do the classification. I read the SVM document and I only find get_support_vector function to get all vectors but I didn't find set_support_vector function. Does anybody have idea how to re-use a trained classifier? Thanks.