weixin_39805355
weixin_39805355
2020-12-07 07:26

TypeError: Expected string passed to parameter 'tensor_names' of op 'SaveV2', got ['Variable', 'Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam', 'Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variab

请问各位 : TypeError: Expected string passed to parameter 'tensor_names' of op 'SaveV2', got ['Variable', 'Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam', 'Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variab 这个错误是为什么? 完整的错误信息是这样: Traceback (most recent call last): File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 511, in _apply_op_helper preferred_dtype=default_dtype) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1175, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 304, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 245, in constant allow_broadcast=True) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 283, in _constant_impl allow_broadcast=allow_broadcast)) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 501, in make_tensor_proto (dtype, nparray.dtype, values)) TypeError: Incompatible types: vs. object. Value is ['Variable', 'Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam', 'Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variable_2/Adam_1', 'Variable_3', 'Variable_3/Adam', 'Variable_3/Adam_1', 'Variable_4', 'Variable_4/Adam', 'Variable_4/Adam_1', 'Variable_5', 'Variable_5/Adam', 'Variable_5/Adam_1', 'beta1_power', 'beta2_power', 'bn_0/beta', 'bn_0/beta/Adam', 'bn_0/beta/Adam_1', 'bn_0/gamma', 'bn_0/gamma/Adam', 'bn_0/gamma/Adam_1', 'bn_0/moving_mean', 'bn_0/moving_variance', 'bn_1/beta', 'bn_1/beta/Adam', 'bn_1/beta/Adam_1', 'bn_1/gamma', 'bn_1/gamma/Adam', 'bn_1/gamma/Adam_1', 'bn_1/moving_mean', 'bn_1/moving_variance', 'feature_bias', 'feature_bias/Adam', 'feature_bias/Adam_1', 'feature_embeddings', 'feature_embeddings/Adam', 'feature_embeddings/Adam_1']

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:/pycharm project/2/main.py", line 148, in y_train_dfm, y_test_dfm = _run_base_model_dfm(dfTrain, dfTest, folds, dfm_params) File "E:/pycharm project/2/main.py", line 68, in _run_base_model_dfm dfm = DeepFM(**dfm_params) File "E:\pycharm project\2\DeepFM.py", line 61, in init self._init_graph() File "E:\pycharm project\2\DeepFM.py", line 156, in _init_graph self.saver = tf.train.Saver() File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 832, in init self.build() File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 844, in build self._build(self._filename, build_save=True, build_restore=True) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 881, in _build build_save=build_save, build_restore=build_restore) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 510, in _build_internal save_tensor = self._AddSaveOps(filename_tensor, saveables) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 210, in _AddSaveOps save = self.save_op(filename_tensor, saveables) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 124, in save_op tensors) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1920, in save_v2 name=name) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 520, in _apply_op_helper repr(values), type(values).name)) TypeError: Expected string passed to parameter 'tensor_names' of op 'SaveV2', got ['Variable', 'Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam', 'Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variable_2/Adam_1', 'Variable_3', 'Variable_3/Adam', 'Variable_3/Adam_1', 'Variable_4', 'Variable_4/Adam', 'Variable_4/Adam_1', 'Variable_5', 'Variable_5/Adam', 'Variable_5/Adam_1', 'beta1_power', 'beta2_power', 'bn_0/beta', 'bn_0/beta/Adam', 'bn_0/beta/Adam_1', 'bn_0/gamma', 'bn_0/gamma/Adam', 'bn_0/gamma/Adam_1', 'bn_0/moving_mean', 'bn_0/moving_variance', 'bn_1/beta', 'bn_1/beta/Adam', 'bn_1/beta/Adam_1', 'bn_1/gamma', 'bn_1/gamma/Adam', 'bn_1/gamma/Adam_1', 'bn_1/moving_mean', 'bn_1/moving_variance', 'feature_bias', 'feature_bias/Adam', 'feature_bias/Adam_1', 'feature_embeddings', 'feature_embeddings/Adam', 'feature_embeddings/Adam_1'] of type 'list' instead.

Process finished with exit code 1

该提问来源于开源项目:ChenglongChen/tensorflow-DeepFM

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

4条回答

  • weixin_39806808 weixin_39806808 5月前

    你好 请问您解决这个问题了吗

    点赞 评论 复制链接分享
  • weixin_39805355 weixin_39805355 5月前

    已解决 但我现在不记得具体要改哪了 晚上回去看了告诉您------------------ 原始邮件 ------------------ 发件人: "boyong-csy" 发送时间: 2019年11月3日(星期天) 上午10:52 收件人: "ChenglongChen/tensorflow-DeepFM"; 抄送: "wylwylwyl"<864500269.com>;"Author"; 主题: Re: [ChenglongChen/tensorflow-DeepFM] TypeError: Expected stringpassed to parameter 'tensor_names' of op 'SaveV2', got ['Variable','Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam','Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variab (#50)

    你好 请问您解决这个问题了吗

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

    点赞 评论 复制链接分享
  • weixin_39806808 weixin_39806808 5月前

    感谢感谢 我今天跑代码突然就馊了 麻烦您了

    ------------------ 原始邮件 ------------------ 发件人: "wylwylwyl"<notifications.com>; 发送时间: 2019年11月3日(星期天) 中午11:00 收件人: "ChenglongChen/tensorflow-DeepFM"<tensorflow-DeepFM.github.com>; 抄送: "守望者"<476745172.com>; "Comment"<comment.github.com>; 主题: Re: [ChenglongChen/tensorflow-DeepFM] TypeError: Expected string passed to parameter 'tensor_names' of op 'SaveV2', got ['Variable', 'Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam', 'Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variab (#50)

    已解决 但我现在不记得具体要改哪了 晚上回去看了告诉您------------------ 原始邮件 ------------------ 发件人: "boyong-csy"<notifications.com> 发送时间: 2019年11月3日(星期天) 上午10:52 收件人: "ChenglongChen/tensorflow-DeepFM"<tensorflow-DeepFM.github.com>; 抄送: "wylwylwyl"<864500269.com>;"Author"<author.github.com>; 主题: Re: [ChenglongChen/tensorflow-DeepFM] TypeError: Expected stringpassed to parameter 'tensor_names' of op 'SaveV2', got ['Variable','Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam','Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variab (#50)

    你好 请问您解决这个问题了吗

    &mdash; You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

    点赞 评论 复制链接分享
  • weixin_39831170 weixin_39831170 5月前

    请问各位 : TypeError: Expected string passed to parameter 'tensor_names' of op 'SaveV2', got ['Variable', 'Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam', 'Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variab 这个错误是为什么? 完整的错误信息是这样: Traceback (most recent call last): File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 511, in _apply_op_helper preferred_dtype=default_dtype) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\ops.py", line 1175, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 304, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 245, in constant allow_broadcast=True) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\constant_op.py", line 283, in _constant_impl allow_broadcast=allow_broadcast)) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 501, in make_tensor_proto (dtype, nparray.dtype, values)) TypeError: Incompatible types: vs. object. Value is ['Variable', 'Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam', 'Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variable_2/Adam_1', 'Variable_3', 'Variable_3/Adam', 'Variable_3/Adam_1', 'Variable_4', 'Variable_4/Adam', 'Variable_4/Adam_1', 'Variable_5', 'Variable_5/Adam', 'Variable_5/Adam_1', 'beta1_power', 'beta2_power', 'bn_0/beta', 'bn_0/beta/Adam', 'bn_0/beta/Adam_1', 'bn_0/gamma', 'bn_0/gamma/Adam', 'bn_0/gamma/Adam_1', 'bn_0/moving_mean', 'bn_0/moving_variance', 'bn_1/beta', 'bn_1/beta/Adam', 'bn_1/beta/Adam_1', 'bn_1/gamma', 'bn_1/gamma/Adam', 'bn_1/gamma/Adam_1', 'bn_1/moving_mean', 'bn_1/moving_variance', 'feature_bias', 'feature_bias/Adam', 'feature_bias/Adam_1', 'feature_embeddings', 'feature_embeddings/Adam', 'feature_embeddings/Adam_1']

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "E:/pycharm project/2/main.py", line 148, in y_train_dfm, y_test_dfm = _run_base_model_dfm(dfTrain, dfTest, folds, dfm_params) File "E:/pycharm project/2/main.py", line 68, in _run_base_model_dfm dfm = DeepFM(dfm_params) File "E:\pycharm project\2\DeepFM.py", line 61, in init self._init_graph() File "E:\pycharm project\2\DeepFM.py", line 156, in _init_graph self.saver = tf.train.Saver() File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 832, in init self.build() File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 844, in build self._build(self._filename, build_save=True, build_restore=True) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 881, in _build build_save=build_save, build_restore=build_restore) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 510, in _build_internal save_tensor = self._AddSaveOps(filename_tensor, saveables) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 210, in _AddSaveOps save = self.save_op(filename_tensor, saveables) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\training\saver.py", line 124, in save_op tensors) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 1920, in save_v2 name=name) File "C:\Program Files\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 520, in _apply_op_helper repr(values), type(values).name**)) TypeError: Expected string passed to parameter 'tensor_names' of op 'SaveV2', got ['Variable', 'Variable/Adam', 'Variable/Adam_1', 'Variable_1', 'Variable_1/Adam', 'Variable_1/Adam_1', 'Variable_2', 'Variable_2/Adam', 'Variable_2/Adam_1', 'Variable_3', 'Variable_3/Adam', 'Variable_3/Adam_1', 'Variable_4', 'Variable_4/Adam', 'Variable_4/Adam_1', 'Variable_5', 'Variable_5/Adam', 'Variable_5/Adam_1', 'beta1_power', 'beta2_power', 'bn_0/beta', 'bn_0/beta/Adam', 'bn_0/beta/Adam_1', 'bn_0/gamma', 'bn_0/gamma/Adam', 'bn_0/gamma/Adam_1', 'bn_0/moving_mean', 'bn_0/moving_variance', 'bn_1/beta', 'bn_1/beta/Adam', 'bn_1/beta/Adam_1', 'bn_1/gamma', 'bn_1/gamma/Adam', 'bn_1/gamma/Adam_1', 'bn_1/moving_mean', 'bn_1/moving_variance', 'feature_bias', 'feature_bias/Adam', 'feature_bias/Adam_1', 'feature_embeddings', 'feature_embeddings/Adam', 'feature_embeddings/Adam_1'] of type 'list' instead.

    Process finished with exit code 1

    请问您是怎么解决的呀

    点赞 评论 复制链接分享

相关推荐