Liang-yc / ssq

该项目用于预测双色球。(This project is dedicated to forecasting the result of welfare lottery named Union Lotto in China.)
MIT License
273 stars 87 forks source link

跑dlt4all.py出错 #31

Open xmjiangz opened 2 years ago

xmjiangz commented 2 years ago

跑ssq4all.py没问题,跑dlt4all.py出错如下: Traceback (most recent call last): File "C:\ssq\dlt\dlt4all.py", line 126, in tf.compat.v1.app.run() File "C:\Program Files\Python39\lib\site-packages\tensorflow\python\platform\app.py", line 36, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "C:\Program Files\Python39\lib\site-packages\absl\app.py", line 312, in run _run_main(main, args) File "C:\Program Files\Python39\lib\site-packages\absl\app.py", line 258, in _run_main sys.exit(main(argv)) File "C:\ssq\dlt\dlt4all.py", line 122, in main run_training() File "C:\ssq\dlt\dlt4all.py", line 59, in run_training input_data = tf.compat.v1.placeholder(tf.float32, [FLAGS.batch_size, 1,7,1]) File "C:\Program Files\Python39\lib\site-packages\tensorflow\python\ops\array_ops.py", line 3298, in placeholder raise RuntimeError("tf.placeholder() is not compatible with " RuntimeError: tf.placeholder() is not compatible with eager execution.

用的是ty2分支,python3.9

aidi971 commented 2 years ago

加上这个tf.compat.v1.disable_eager_execution()

xmjiangz commented 2 years ago

加上这个tf.compat.v1.disable_eager_execution()

加上就可以了,谢谢