DeepCTR icon indicating copy to clipboard operation
DeepCTR copied to clipboard

UnboundLocalError: local variable 'e_1' referenced before assignment

Open shanengcn opened this issue 3 years ago • 4 comments

请问下 直接跑知识里面那个例子,报这个错是什么原因? TensorFlow 1.14

shanengcn avatar Sep 08 '21 06:09 shanengcn

知识里面那个例子是啥?

请按照Bug report模板给出更多信息

Describe the bug(问题描述) A clear and concise description of what the bug is.

To Reproduce(复现步骤) Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Operating environment(运行环境):

  • python version [e.g. 3.5, 3.6]
  • torch version [e.g. 1.6.0, 1.7.0]
  • deepctr-torch version [e.g. 0.2.7,]

Additional context Add any other context about the problem here.

zanshuxun avatar Oct 01 '21 16:10 zanshuxun

跑https://github.com/shenweichen/DeepCTR/blob/master/examples/run_classification_criteo.py 试试呢

zanshuxun avatar Oct 01 '21 16:10 zanshuxun

遇到同样报错,升级tensorflow版本倒1.15后问题解决。试图复现不成功……

日志:log.txt

Call initializer instance with the dtype argument instead of passing it to the constructor make sure the activation function use training flag properly call() got an unexpected keyword argument 'training'

StagingError: in converted code:

/mnt/user_profile/context/anaconda3/envs/python37/lib/python3.7/site-packages/deepctr/layers/core.py:183 call *
    for i in range(len(self.hidden_units)):
/mnt/user_profile/context/anaconda3/envs/python37/lib/python3.7/site-packages/tensorflow/python/autograph/operators/control_flow.py:110 for_stmt
    return _py_for_stmt(iter_, extra_test, body, init_state)
/mnt/user_profile/context/anaconda3/envs/python37/lib/python3.7/site-packages/tensorflow/python/autograph/operators/control_flow.py:119 _py_for_stmt
    state = body(target, *state)
/tmp/tmpgvqt0u8p.py:37 loop_body
    return e_1, deep_input_1

UnboundLocalError: local variable 'e_1' referenced before assignment

wywzxxz avatar Jan 20 '22 09:01 wywzxxz

同样问题,必须升级到1.15吗,现在是linux tensorflow1.14 调用所有算法都报错,有不升级tensorflow的解决方案吗

Malestudents avatar Jan 18 '23 03:01 Malestudents