Weakly_detector icon indicating copy to clipboard operation
Weakly_detector copied to clipboard

All-in-one Jupyter notebook for Caltech dataset

Open MasoodK opened this issue 7 years ago • 6 comments

A Jupyter notebook including the main files needed to train the VGG model on Caltech256 dataset. Notebook includes code updates (TF v1.2) and documentation, among others.

MasoodK avatar Jul 23 '17 23:07 MasoodK

Hi, First thank you so much for creating this. It was really helpful. I tried to run the last part of the code on my customized dataset where it should generate the CAM images. But it seems to run forever to generate the images. Do you have any idea about why it occurs? Thank you.

taylorty avatar Nov 07 '17 02:11 taylorty

@taylorty , glad you found the notebook useful. Not sure, however, I understand what your specific issue is. You will need to reproduce the whole A-Z of the process/cells in your environment. If that checks out, then you can proceed to adapt the model to your own dataset. By adapting, I mean doing at least some training before going to prediction, so that the model is correctly tuned to the number of labels, etc., in your set. To help you debug along the way, you can use simple Print statements to check things, or move to Python or TensorFlow debug tools if needed. Hope this helps :)

MasoodK avatar Nov 07 '17 17:11 MasoodK

@MasoodK I just figured out what was the problem. Adding %matplotlib inline before plotting makes everything work as expected.

taylorty avatar Nov 07 '17 21:11 taylorty

Hi , Thanks for your effort and the notebook was really helpful . May I Know whether a trained model is available which I can use to test on caltech256 dataset ?

Rahul-Venugopal avatar Jan 03 '19 23:01 Rahul-Venugopal

@MasoodK @jazzsaxmafia I am running the jupyter notebook code and when I run the cell for training I get the following error :

TypeError Traceback (most recent call last) in 15 labels_tf = tf.placeholder( tf.int64, [None], name='labels') 16 ---> 17 detector = Detector(weight_path, n_labels) 18 19 p1,p2,p3,p4,conv5, conv6, gap, output = detector.inference(images_tf)

in init(self, weight_file_path, n_labels) 5 6 with open(weight_file_path) as f: ----> 7 self.pretrained_weights = cPickle.load(f) 8 9 def get_weight( self, layer_name):

TypeError: a bytes-like object is required, not 'str'

Can anyone help me to understand the mistake I am making ?

Rahul-Venugopal avatar Jan 03 '19 23:01 Rahul-Venugopal

Hi , Thanks for your effort and the notebook was really helpful . May I Know whether a trained model is available which I can use to test on caltech256 dataset ?

@Rahul-Venugopal The link to the Caffe model is already provided by the repo owner; you'd download that file. The code/notebook loads that up and starts the fine-tuning.

Regarding your 2nd comment: you gotta have basic Python debugging skills to have a crack at this. Not sure what your issue is; looks like you've indicated a wrong path to the model file or sth similar.

MasoodK avatar Jan 06 '19 02:01 MasoodK