-
Notifications
You must be signed in to change notification settings - Fork 652
example of loading a tensorflow model #34
Comments
We do not yet, and we will add one. Thank you for your patience! |
thanks, looking forward to! |
Thanks for reply. I just notice that model should be from moralex@'s modelzoo when using optvis. Is there any differences between the models in modelzoo and our trained models? BTW, could you please provide a link for moralex@'s modelzoo? Thanks. |
Hey everyone (@machuck, @Wursthub, @emptyewer, @JegZheng)! https://drive.google.com/file/d/1PPzeZi5sBN2YRlBmKsdvZPbfYtZI-pHl Thanks for your continued patience! :-) |
Hi Ludwig, I am successfully training using TensorFlow 1.8.0 on the standard SSD MobileNet V1 model config file, and exporting graphs using the object_detection script "export_inference_graph.py". I'm working in continuous mode whereby I collect and classify new images every day, feed back some of them to the Ground Truth data set, and then train again (once a week). So I'm very keen and interested to use Lucid to explore the output models and to inform the "feedback-to-ground-truth" step in a more scientific way. Obviously it's amazingly cool too. So I jumped in, tried the tutorial notebook, and it worked perfectly. But when I switched to one of my own exported graphs I got errors. What did I expect - I've managed to get this far without really understanding what's going on with Tensorflow graphs. Eventually I understood that the "input" and "layer" choices are critical. There are so many different errors that occur if these are poor choices, largely due to the "non-backpropagatability" of operations in the graph between the designated "input" and "layer". I was massively helped by the example on this site: https://github.com/Hvass-Labs/TensorFlow-Tutorials/blob/master/14_DeepDream.ipynb What works for me is:
|
Hi @tul-urte, Regarding your concrete issue:
In your current code you create a new placeholder that's not connected at all to your original model's loaded graph. That's why you get the "No gradients…" Value Error. You shouldn't have to modify the Use the code in the linked notebook ( Hope this helped! Let me know whether it did or did not. :-) |
Thanks for this thread! It would be awesome if this package interfaces with generic Tensorflow models easily. |
Hi @ludwigschubert , I am getting a You mentioned that this can be caused by the placeholder being disconnected from the graph. However, I did not modify the Modelzoo metadata that I used: class Net(Model):
model_path = 'pre_trained_model/frozen_model.pb'
image_shape = [28, 28, 1]
image_value_range = (0, 1)
input_name = 'Reshape' |
@namnov you use Please let me know if this helped, I may have a follow up question. |
@ludwigschubert Thank you! Turns out the problem was that I was using Some comments: Also, |
UPDATE: got the code to run by changing Hi @ludwigschubert, I trained an unmodified version of ssdmobilenet_v1 from tensorflow's object detection API models/research/object_detection and I have been trying to visualize the activation of neuron groups in one of the feature extraction layers. I started with this code:
where
but ended up getting:
I looked into this and I think it has something to do with the graph_def containing So I'm thinking that this means the graph_def created by
I managed to get pass this by using the nonbinary graph def file (pbtxt instead of pb):
Modifying the model_path to If you have any suggestions or comments, they would be really appreciated. Sorry for such a long post but I thought more details would be better. |
Hi, I'm trying to work through your importing a model tutorial and put my keras trained autoencoder through Lucid to study the encoded representations but I'm stuck on the part of your tutorial below
The traceback is
Perhaps relevant is how I transferred the model from keras format to tensorflow format
|
@ludwigschubert any updates on how to add a Keras/TF model to Modelzoo? Also, is lucid already supporting multichannel images (> 3)? I'm working with @CasperN on that CAE model, and we definitely want to use Lucid on it :) |
@CasperN did you ever find a solution to this? I am also trying to freeze a model I've compiled and trained via Keras and am receiving the same:
Error when freezing via freeze_graph. |
@CasperN @johnknelsonintific Hi I have the smae problem. Do you have any solution now? Thank |
@ricardobarroslourenco I think you solved this one. |
Hi, do we have an example of loading a tensorflow model some where in the docs already? If not yet, can you provide one? thanks
The text was updated successfully, but these errors were encountered: