Code Monkey home page Code Monkey logo

Comments (8)

tyongguang avatar tyongguang commented on September 26, 2024

把beam_search相关的注释打开才行。。。

from tensorflow_practice.

bqFirst avatar bqFirst commented on September 26, 2024

看起来中文的项目确实漏洞百出啊

from tensorflow_practice.

bqFirst avatar bqFirst commented on September 26, 2024

把beam_search相关的注释打开才行。。。

predict跑起来了吗

from tensorflow_practice.

tyongguang avatar tyongguang commented on September 26, 2024

把beam_search相关的注释打开才行。。。

predict跑起来了吗

能predict 起来。但绝对不是你想像中那样子:
第一,输入输出都是英文
第二,效果很差

from tensorflow_practice.

bqFirst avatar bqFirst commented on September 26, 2024

把beam_search相关的注释打开才行。。。

predict跑起来了吗

能predict 起来。但绝对不是你想像中那样子:
第一,输入输出都是英文
第二,效果很差

嗯嗯,跑起来了,训练数据都是英文的,输入中文的话不知道能不能理解,确实答非所问

from tensorflow_practice.

shengqiangzhang avatar shengqiangzhang commented on September 26, 2024

把beam_search相关的注释打开才行。。。

predict跑起来了吗

能predict 起来。但绝对不是你想像中那样子:
第一,输入输出都是英文
第二,效果很差

嗯嗯,跑起来了,训练数据都是英文的,输入中文的话不知道能不能理解,确实答非所问

请问tf版本是多少?我在predict出错了。
报错如下:

2019-12-17 14:15:28.290374: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290477: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290502: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290489: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290570: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290810: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290841: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
Traceback (most recent call last):
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call
    return fn(*args)
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn
    status, run_metadata)
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
	 [[Node: encoder/rnn/All/_55 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_69_encoder/rnn/All", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

from tensorflow_practice.

bqFirst avatar bqFirst commented on September 26, 2024

把beam_search相关的注释打开才行。。。

predict跑起来了吗

能predict 起来。但绝对不是你想像中那样子:
第一,输入输出都是英文
第二,效果很差

嗯嗯,跑起来了,训练数据都是英文的,输入中文的话不知道能不能理解,确实答非所问

请问tf版本是多少?我在predict出错了。
报错如下:

2019-12-17 14:15:28.290374: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290477: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290502: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290489: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290570: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290810: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
2019-12-17 14:15:28.290841: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
Traceback (most recent call last):
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call
    return fn(*args)
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn
    status, run_metadata)
  File "/home/zsq/anaconda3/envs/tf1.4/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 1024 values, but the requested shape has 5120
	 [[Node: decoder/Reshape_4 = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:GPU:0"](decoder/AttentionWrapperZeroState/zeros_1, decoder/concat_4)]]
	 [[Node: encoder/rnn/All/_55 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_69_encoder/rnn/All", tensor_type=DT_BOOL, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

不是tf的问题,训练和预测时不要用beam_search(beam_search=False)

from tensorflow_practice.

shengqiangzhang avatar shengqiangzhang commented on September 26, 2024

from tensorflow_practice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.