Tensorflow TypeError: load() missing 2 required positional arguments: 'tags' and 'export_dir'

网友投稿 2059 2022-08-22

tensorflow TypeError: load() missing 2 required positional arguments: 'tags' and 'export_dir'

Tensorflow TypeError: load() missing 2 required positional arguments: 'tags' and 'export_dir'

今天在运行别人的tensorflow代码的时候,出现了下面的错误:

This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0.Traceback (most recent call last): File "main.py", line 56, in imported = tf.saved_model.load(cartoon_path) File "/home/touyan/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 324, in new_func return func(*args, **kwargs)TypeError: load() missing 2 required positional arguments: 'tags' and 'export_dir'

查看tf2.0的官网发现写法没啥错:

imported = tf.saved_model.load(path)f = imported.signatures["serving_default"]print(f(x=tf.constant([[1.]])))

​​uninstall tensorflow-gpupip uninstall tensorflowpip install tensorflow==2.0

升级到2.0就没事了哈

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:正则表达式之基本概念(正则表达式定义)
下一篇:xml.parsers.expat.ExpatError: not well-formed (invalid token)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~