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

ValueError: Unsupported Ops in the model before optimization RandomStandardNormal #4156

Closed
zhangchengtan opened this issue Oct 29, 2020 · 3 comments · Fixed by #6533
Closed

Comments

@zhangchengtan
Copy link

I encountered following error for an unsupported operation while use tensorflowjs_converter convert python model to a tfjs model.

G:\sever_git\ml-agents\modelBoard\saved_model>tensorflowjs_converter --input_format=tf_frozen_model --output_format=tfjs_graph_model --output_node_nam
es=action --saved_model_tags=serve ./frozen_graph_def.pb ./web_model
2020-10-29 14:32:22.020098: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library cudart64_101.dll
Traceback (most recent call last):
File "d:\users\administrator\anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "d:\users\administrator\anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "d:\Users\Administrator\Anaconda3\Scripts\tensorflowjs_converter.exe_main
.py", line 7, in
File "d:\users\administrator\anaconda3\lib\site-packages\tensorflowjs\converters\converter.py", line 757, in pip_main
main([' '.join(sys.argv[1:])])
File "d:\users\administrator\anaconda3\lib\site-packages\tensorflowjs\converters\converter.py", line 761, in main
convert(argv[0].split(' '))
File "d:\users\administrator\anaconda3\lib\site-packages\tensorflowjs\converters\converter.py", line 744, in convert
experiments=args.experiments)
File "d:\users\administrator\anaconda3\lib\site-packages\tensorflowjs\converters\tf_saved_model_conversion_v2.py", line 489, in convert_tf_frozen_mo
del
experiments=experiments)
File "d:\users\administrator\anaconda3\lib\site-packages\tensorflowjs\converters\tf_saved_model_conversion_v2.py", line 146, in optimize_graph
', '.join(unsupported))
ValueError: Unsupported Ops in the model before optimization
RandomStandardNormal

@rthadur rthadur added the type:feature New feature or request label Oct 29, 2020
@rthadur
Copy link
Contributor

rthadur commented Oct 29, 2020

cc @pyu10055

@rthadur rthadur added the P3 label Nov 5, 2020
@amchaudhari
Copy link

amchaudhari commented May 3, 2021

Is this issue resolved? Because I am getting the same error when I include the following sampling layer in my model.

class Sampling(tf.keras.layers.Layer):
	"""Uses (z_mean, z_log_var) to sample z"""

	def call(self, inputs):
		z_mean, z_log_var = inputs
		batch = tf.shape(z_mean)[0]
		dim = tf.shape(z_mean)[1]
		epsilon = tf.random.normal(shape)
		return z_mean + tf.exp(0.5 * z_log_var) * epsilon

Tensorflow version = 2.3.1
Tensorflowjs version = 3.6.0

@rthadur
Copy link
Contributor

rthadur commented May 3, 2021

not yet , this is a feature request and is very low on priority, if you are willing to contribute , here are the contribution guidelines https://github.com/tensorflow/tfjs/blob/master/CONTRIBUTING_MISSING_OP.md

mattsoulanille added a commit that referenced this issue Jun 21, 2022
Fixes #4156

Co-authored-by: Matthew Soulanille <msoulanille@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants