Closed tm2313 closed 6 years ago
This would be caused if you are running the script above from a folder where you do not have write permissions. So, when it tries to save the mdoel, it does not have the necessary permissions to write the models folder in the current directory. Try running from a different directory where you have permissions - that should solve your problem.
Hmm, that's probably it - I wasn't sure if it was the input for the function or if it was when it was trying to write something. I've been having problems with the server that work has set me up with recently, but I thought they'd been fixed. Unfortunately, this probably means that I'll be having the same issue no matter where I run the script. Thanks very much for the help, at any rate.
You could run it locally on your machine if you want.
That's true. I might ask our system admin about it when he has the time. Cheers.
Okay, so I've tried running the script locally and I've run into another issue. At the moment, I'm importing a Keras model with BatchNormalization layers. Normally when you try and do this, you need to specify a learning phase variable and pass it to feed_dict as a seperate tensor. For example, with the script above, I am assuming I provide the input like so:
value_feed_dict = {X: im, K.learning_phase(): 0}
However, this is giving me the following error:
Traceback (most recent call last):
File "vis2.py", line 36, in <module>
is_success = tfv.activation_visualization(sess_graph_path=tf.get_default_graph(), value_feed_dict = {X : im, K.learning_phase(): 0}, layers=layers)
File "/usr/local/anaconda3/lib/python3.6/site-packages/tf_cnnvis-1.0.0-py3.6.egg/tf_cnnvis/tf_cnnvis.py", line 406, in activation_visualization
File "/usr/local/anaconda3/lib/python3.6/site-packages/tf_cnnvis-1.0.0-py3.6.egg/tf_cnnvis/tf_cnnvis.py", line 169, in _get_visualization
File "/usr/local/anaconda3/lib/python3.6/site-packages/tf_cnnvis-1.0.0-py3.6.egg/tf_cnnvis/tf_cnnvis.py", line 227, in _visualization_by_layer_type
File "/usr/local/anaconda3/lib/python3.6/site-packages/tf_cnnvis-1.0.0-py3.6.egg/tf_cnnvis/tf_cnnvis.py", line 270, in _visualization_by_layer_name
File "/usr/local/anaconda3/lib/python3.6/site-packages/tf_cnnvis-1.0.0-py3.6.egg/tf_cnnvis/utils.py", line 79, in parse_tensors_dict
AttributeError: 'int' object has no attribute 'name'
Can I set learning_phase to 0 in value_feed_dict as I would with feed_dict, or should I be doing something differently ?
Hi there,
I'm trying to use the library with a pretrained model to visualise features. I think where I'm coming stuck is providing the graph to the activation_visualisation function (i.e. I don't think this is a problem with Tensorflow - I'm running other scripts that seem to work okay).
I'm still fairly new to Tensorflow, so it may be an issue with where I'm working in the session, but I've tried jostling the activation_visualization function around to no avail.
This is the error message I get.
As an aside, would it be possible in future to provide protobuf files directly as input to the function? As I said, I'm new to Tensorflow, so I'm not sure how easy it would be.