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

Input issues with tfjs conversion #4861

Closed
rohanmuplara opened this issue Mar 25, 2021 · 4 comments
Closed

Input issues with tfjs conversion #4861

rohanmuplara opened this issue Mar 25, 2021 · 4 comments

Comments

@rohanmuplara
Copy link

Hi,
I am not sure how the inputs are translated with the tfjs converter with named inputs.
https://colab.research.google.com/drive/1F1xO8950vJrw2JfVUDiid5pXAdOoo0lI?usp=sharing. I run this code multiple times and the order that the inputs appear in the conversion file change everytime(code is the same just reset runtime.) Additionally, the names change everytime, ie sometimes times input_0 and 1, sometimes input_5, input_6(no input 1 through 4) and the order that these appear in the json everytime changes. I was wondering if anything can be done as it means everytime I receonvert my model I have to change my tfjs code. I also have many inputs of same dimensions so is there is any way to figure out the mapping happens.
I also have attached a screen recording explaining my issues: https://share.descript.com/view/5xYQx07Q7T4
Thanks,
Rohan

@pyu10055
Copy link
Collaborator

@rohanmuplara I took a look at your colab, looks like you can fix the input layer names by setting the name param for tf.keras.Layers API.
I have seen the signature of model created to stay the same after that change.

@rohanmuplara
Copy link
Author

Yes thanks for the tip and this works great. I don't think this as much of a tfjs issue more like regular tensorflow issue and this could be just my opinion but it would be a little more idiomatic/convenient for it to use the dictionary provided in model than to use passing in the names to the input. Right now it never uses the names provided in dictionary to model and will only change signature if you change input layer names.

@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.

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