MrXiaoXiao / ESPRH

Automatic earthquake catalog building workflow: EQTransformer + Siamese EQTransformer + PickNet + REAL + HypoInverse
MIT License
18 stars 4 forks source link

NameError: name 'session' is not defined #7

Closed shenxuanye closed 1 year ago

shenxuanye commented 1 year ago

请问一下,在执行03_run_PickNet.py时,未得到变量session,是那里出了问题呢?

MrXiaoXiao commented 1 year ago

是不是tensorflow或者cuda版本问题啊,有没有更详细一点的报错信息

shenxuanye commented 1 year ago

在03_run_PickNet.py脚本中第42行tester.setup(session)执行时,未找到变量session。 tensorflow版本按照您文件中的要求是1.14版本,是否需要升级为2.*版本?

MrXiaoXiao commented 1 year ago

应该不需要升级到2的。我刚刚扫了一眼,前面好像没有声明这个session,你在40行加一下

K.clear_session() session = get_session() KTF.set_session(session)

可能是上传的版本问题,不知道为啥之前他们没遇到这个问题 (lll¬ω¬)

MrXiaoXiao commented 1 year ago

我刚刚更新了下03,你看看是不是可以了

shenxuanye commented 1 year ago

按照您的解答,修改后,现在可以顺利运行,感谢您的耐心解答。

ZamirKhurshid commented 11 months ago

I have Changed this line with the following but that does not work it shows (NameError: name 'get_session' is not defined) Can you please check, how I can fix this error. K.clear_session() session = get_session() KTF.set_session(session)

MrXiaoXiao commented 11 months ago

I have Changed this line with the following but that does not work it shows (NameError: name 'get_session' is not defined) Can you please check, how I can fix this error. K.clear_session() session = get_session() KTF.set_session(session)

I've updated the script '03_run_PickNet.py'. Please try the new script and see if it solves your problem.

ZamirKhurshid commented 11 months ago

Thank you sir, Now Its working smoothly.