stanford-futuredata / noscope

Accelerating network inference over video
http://dawn.cs.stanford.edu/2017/06/22/noscope/
436 stars 122 forks source link

Can I output the optimized model? #37

Open janhuang6 opened 6 years ago

janhuang6 commented 6 years ago

Once NoScope optimized the model for a video, can it output the optimized model so I can use it to process more videos from the same fixed camera without having to optimize again for each video? For instance, I have 5 videos from the same camera. NoScope found the optimized model from the 1st video, then how to run that model for the remaining 4 videos without the optimization again? Thank you!

ddkang commented 6 years ago

This is possible, take a look at https://github.com/stanford-futuredata/noscope/blob/master/exp/shuffled_small_cnn.py

janhuang6 commented 6 years ago

Hi, Daniel, thanks for directing me to the file shuffled_small_cnn.py. I made some change to this file. But when I ran NoScope, I found this file (and my changes too) were not executed. So what to do to execute it? Thanks! Jan

janhuang6 commented 6 years ago

Hi, Daniel, finally I run shuffled_small_cnn.py directly and it generated the Model output: model_convnet_128_32_0.csv model_convnet_128_32_0.h5 .... model_convnet_summary.csv

Now, is there a sample code that will read the model in and create the TensorFlow instance from it?

Thank you so much! Jan

sxhexe commented 6 years ago

I believe that's https://github.com/stanford-futuredata/noscope/blob/master/scripts/export-tf-graphs.py.

janhuang6 commented 6 years ago

Hi, sxhexe, thanks for the link. I executed that file "export-tf-graphs.py". It generated some .pb files. I think those are the TensorFlow Model Files. Is there a sample code that will read in the model .pb files and restore the TF model and run it?

sxhexe commented 6 years ago

I don't know. Maybe look into tensorflow documentation?