keract: NameError: name 'k' is not defined
Hi,
I’ve been getting below issue trying to visualize activation heatmaps . I can’t seem to understand why, since as I understand is just the channels_last format from keras backend.
I can see that in below line of keract.py the K is capital and in data_format = k.image_data_format() is not?
I didn’t have an issue with display_activations and first meets what display_heatmaps requires as input.
Am I missing something?
first = np.array(activations.get('bAct-1/Relu:0'))
keract.display_activations(activations, save=False)
first.shape, k.image_data_format()
((1, 20, 40, 8), 'channels_last')
keract.display_heatmaps(activations, first, save=False)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-74-ebed9f04da1c> in <module>()
----> 1 keract.display_heatmaps(activations, first, save=False)
~/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/keract/keract.py in display_heatmaps(activations, input_image, directory, save, fix)
194 import math
195
--> 196 data_format = k.image_data_format()
197 if fix:
198 # fixes common errors made when passing the image
NameError: name 'k' is not defined
DV
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 25 (12 by maintainers)
@danvargg thanks we are working hard to make a good lib 😃 Good luck!!
Problem of K corrected:
https://github.com/philipperemy/keract/commit/ce6df18d5f76f8dc69cbe611db881375bce552e2