tensorflow 2.0,variable_scope(),TypeError:__call __()获得了意外的关键字参数“ partition_info”

时间:2019-03-13 12:26:13

标签: tensorflow tensorflow2.0

我已经使用 ## cPanel Prevent Addon Domain Duplicate Content – Redirect all to www domain RewriteCond %{HTTP_HOST} ^(www\.)?(yahoo\.)?google.com$ [OR] RewriteCond %{HTTP_HOST} ^yahoo\.com$ RewriteRule ^yahoo\.com/?(.*)$ http://www.yahoo.com/$1 [R=301,L]将CNN模型从tf1.x转换为tf2.0,但是当我使用此转换后的模型时,却出现了错误:

tf_upgrade_v2

File "/home/hsw/virtual_env/tf2.0/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 2492, in default_variable_creator import_scope=import_scope, distribute_strategy=distribute_strategy) File "/home/hsw/virtual_env/tf2.0/lib/python3.6/site-packages/tensorflow/python/ops/variables.py", line 216, in __call__ return super(VariableMetaclass, cls).__call__(*args, **kwargs) File "/home/hsw/virtual_env/tf2.0/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 422, in __init__ constraint=constraint) File "/home/hsw/virtual_env/tf2.0/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 545, in _init_from_args initial_value() if init_from_fn else initial_value, File "/home/hsw/virtual_env/tf2.0/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 886, in <lambda> shape.as_list(), dtype=dtype, partition_info=partition_info) TypeError: __call__() got an unexpected keyword argument 'partition_info'中似乎出了点问题,而转换后的模型是这样的:

variables.py

应如何解决此问题?

1 个答案:

答案 0 :(得分:0)

这是一个错误,已经在github上提交了。参见其中的讨论:https://github.com/tensorflow/tensorflow/issues/26665#issuecomment-472950222