Tensorflow错误:TypeError:Fetch参数None具有无效类型<type'nonetype'=“”>

时间:2017-02-24 07:02:31

标签: python tensorflow

运行以下代码时出现错误“TypeError:Fetch参数无无效类型”:

self.optimize_op

这是我的网络定义:

_

我注意到这个post提出了同样的问题,但上面的代码似乎与答案相同,因为我将Traceback (most recent call last): File "main.py", line 182, in <module> main(params) File "main.py", line 118, in main loss, actor_params, critic_params = agent.train(batch, total_steps) File "/home/ld/code_base/drl/new_experiment/ddpg_torcs_v3.0/agent.py", line 61, in train loss, critic_params = self.net.train(x1, x2, y) # 1.42s File "/home/ld/code_base/drl/new_experiment/ddpg_torcs_v3.0/critic.py", line 152, in train self.y: y File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 766, in run run_metadata_ptr) File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 951, in _run fetch_handler = _FetchHandler(self._graph, fetches, feed_dict_string) File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 407, in __init__ self._fetch_mapper = _FetchMapper.for_fetch(fetches) File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 230, in for_fetch return _ListFetchMapper(fetch) File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 337, in __init__ self._mappers = [_FetchMapper.for_fetch(fetch) for fetch in fetches] File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 230, in for_fetch return _ListFetchMapper(fetch) File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 337, in __init__ self._mappers = [_FetchMapper.for_fetch(fetch) for fetch in fetches] File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 230, in for_fetch return _ListFetchMapper(fetch) File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 337, in __init__ self._mappers = [_FetchMapper.for_fetch(fetch) for fetch in fetches] File "/home/ld/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 227, in for_fetch (fetch, type(fetch))) TypeError: Fetch argument None has invalid type <type 'NoneType'> 分配给function bar() { function foo() {} var foo = 11; return foo; foo = 10; } alert(typeof bar());

注意:我的张量流版本是0.12.1

编辑: 这是我的错误消息:

const sum = (a, b) => {
   return a + b;
};

export default sum

0 个答案:

没有答案