Skip to content
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

How to use Keras.backend in TensorflowJS ? #4837

Closed
jackfrost1411 opened this issue Mar 19, 2021 · 7 comments
Closed

How to use Keras.backend in TensorflowJS ? #4837

jackfrost1411 opened this issue Mar 19, 2021 · 7 comments

Comments

@jackfrost1411
Copy link

jackfrost1411 commented Mar 19, 2021

The below code snippet is written in python Keras.

from keras import backend as K
...

layer_name ='Mask'
NewInput = model.get_layer(layer_name).output
visualization = K.function([model.input], [NewInput])
...

I want to write this code in Tensorflow.JS .. I am unable to find the right lines in TensorflowJS for this code snippet.

Can anyone help ?!

@jackfrost1411
Copy link
Author

I had to reopen this issue as I couldn't find the solution anywhere.. Is there an alternative for doing the above task?

@pyu10055
Copy link
Collaborator

There some of the concept of backend in the tfjs-core package, what is the particular thing you want to do on the keras backend package?

@jackfrost1411
Copy link
Author

There some of the concept of backend in the tfjs-core package, what is the particular thing you want to do on the keras backend package?

I have trained a model Keras that ends with a softmax layer. But I want to get output from an intermediate Convolution layer. How can I do this?

@pyu10055
Copy link
Collaborator

You can access layers using tfjs-layers function model, example is here
https://stackoverflow.com/questions/50942677/tensorflowjs-how-to-get-inner-layer-output-in-a-cnn-prediction/51316516#51316516

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you.

@google-ml-butler
Copy link

Closing as stale. Please @mention us if this needs more attention.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants