-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'NoneType' object has no attribute 'outer_context' #26
Comments
Hi @HeminQadir |
I used
|
Hi! Thanks! |
I actually did that, but I am still getting the same error. Here is what I have:
some times I just use I am about to submit my paper, but I need to include deconvolution visualization. BTW, How we can cite this work? Thanks! |
Hi @HeminQadir |
@HeminQadir @falaktheoptimist Hi, I tried
|
I'm having the same issue with mobilenet v2 ssd models: I'm using the model.ckpt generated by I tried to use Then I tried to pass model.ckpt.meta file path(string) into
Am I using |
Facing same issue after using Code sess = tf.Session()
saver = tf.train.import_meta_graph('data/ssdlite_mobilenet_v2_coco_2018_05_09/model.ckpt.meta')
saver.restore(sess, 'data/ssdlite_mobilenet_v2_coco_2018_05_09/model.ckpt')
t_input = tf.get_default_graph().get_tensor_by_name('import/ToFloat:0')
deepdream_visualization(sess_graph_path = sess, value_feed_dict = {t_input: im},
layer='import/detection_scores', classes = [1, 2, 3, 4, 5],
path_logdir=path_logdir, path_outdir=path_outdir) Error
|
@endeepak I've managed to get deconv working(sort of) with ssd mobilenet v2, thanks for your insight :) Here's what I did:
The key here is passing the checkpoint file as a string for Also using And tring to deconv So it looks like we can only visualize the feature extractor part at the moment? |
Hello @wildpig22, Here is the small snippet to import the coco model graph :
|
@BhagyeshVikani were you able to get an interpretable image from |
@endeepak Not yet. But we are working on that. Can you please provide the name of the last output layer in the graph? |
Thanks @BhagyeshVikani. There are 4 output layers in this graph I found the output layer names by running
|
@BhagyeshVikani thanks! I've got one question though, since the node |
Aah Good Point @wildpig22. |
@BhagyeshVikani @falaktheoptimist There is a issue about
when i try to import Faster-Rcnn resnet101 model, there is the code: from tf_cnnvis import * import tensorflow as tf image_tensor = tf.placeholder(np.float32, name='image_tensor') # define the input tensor mean = 2/255.0 im = np.expand_dims(imresize(imread("/notebooks/workspace/data/1.jpg"), (300, 300)), axis = 0) im_processed = im * mean - dev layers = ["r", "p", "c"] start = time.time() #Pass ckpt path as a string would work start = time.time() - start it is caused by loop calculate gradient? and then how to solve it? thanks a lot |
@aggpankaj2 Different CNNNet has different |
@jidebingfeng resnet only. |
See this comment |
So, we think we now have this error finally figured out. This occurs when there is an operation/ block in the network which does not have a gradient defined. This would mean that while the forward pass (activation visulaization) would work fine, the backward pass would produce the above NoneType error as the backward propagation of the gradient would break when it reaches the layer/ op for which gradient is not defined. We tested and this was the case for the model in which such blocks were present. Someone from this long and longstanding thread please express your confirmation / negation. |
Hi, #Here is how my placeholder looks in my class init(). CNN input shape is 864x480
#visualization function
Issue 1:- Issue 2:- Code from model.py#.. various layers go here. Thanks in advance for your suggestions. |
With regard to the above issue comment, I have tried one additional api for input_tensor. input_tensor = tf.contrib.framework.get_variables_by_name('in_layer') #tried different layers names. The names exist in the model code (which are created by tf.layer ) Error comes at tf_cnnvis.py line 282. _visualization_by_layer_name -
AttributeError: 'list' object has no attribute 'name' Just in case you suspect the way I built model, here are the final layer and model function.
Thanks |
Hi,
I am trying to visualize inception_resent_v2 layers.
And that is how I load the Graph;
I use tf_cnnvis twice, first one to visualize the activation layers, and second one for deconstruction.
The first one is working successfully, but when I try to deconstruction I get the following error;
AttributeError: 'NoneType' object has no attribute 'outer_context'
any idea what is wrong?
Regards
The text was updated successfully, but these errors were encountered: