python extension error

639 views
Skip to first unread message

Miaojia Lu

unread,
Mar 22, 2021, 3:19:16 PM3/22/21
to netlogo-users
Hi all,

Here is the error when I run the traffic basic reinforcement learning model:
Extension exception: module 'keras.optimizers' has no attribute 'adam'
error while observer running PY:RUN
  called by procedure SETUP
  called by procedure SETUP-TF
  called by Button 'setup-tf'

org.nlogo.nvm.WrappedExtensionException: Extension exception: module 'keras.optimizers' has no attribute 'adam'
 at org.nlogo.prim._extern.perform(_extern.java:40)
 at org.nlogo.nvm.Context.stepConcurrent(Context.java:107)
 at org.nlogo.nvm.ConcurrentJob.step(ConcurrentJob.scala:65)
 at org.nlogo.job.JobThread.runPrimaryJobs(JobThread.scala:133)
 at org.nlogo.job.JobThread.$anonfun$run$1(JobThread.scala:68)
 at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
 at scala.util.control.Exception$Catch.apply(Exception.scala:228)
 at org.nlogo.api.Exceptions$.handling(Exceptions.scala:41)
 at org.nlogo.job.JobThread.run(JobThread.scala:66)
Caused by: org.nlogo.api.ExtensionException: module 'keras.optimizers' has no attribute 'adam'
 at org.nlogo.extensions.py.PythonSubprocess.pythonException(PythonExtension.scala:389)
 at org.nlogo.extensions.py.PythonSubprocess.run(PythonExtension.scala:343)
 at org.nlogo.extensions.py.PythonSubprocess.$anonfun$exec$2(PythonExtension.scala:373)
 at org.nlogo.extensions.py.PythonSubprocess.$anonfun$async$1(PythonExtension.scala:314)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Traceback (most recent call last):
  File "G:\Netlogo\app\extensions\.bundled\py\pyext.py", line 143, in logo_responder
    exec(code, globs)
  File "<string>", line 6, in <module>
AttributeError: module 'keras.optimizers' has no attribute 'adam'

 ... 7 more

NetLogo 6.2.0
main: org.nlogo.app.AppFrame
thread: JobThread
OpenJDK 64-Bit Server VM 1.8.0_275 (BellSoft; 1.8.0_275-b01)
operating system: Windows 10 10.0 (amd64 processor)
Scala version 2.12.12
JOGL: (3D View not initialized)
OpenGL Graphics: (3D View not initialized)
model: Traffic Basic - Reinforcement

05:13:59.328 RuntimeErrorEvent (org.nlogo.app.App$$anon$4 (org.nlogo.window.GUIWorkspace)) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.widget.SwitchWidget) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0
05:13:59.324 InterfaceGlobalEvent (org.nlogo.app.interfacetab.InterfacePanel$$anon$1 (org.nlogo.window.SliderWidget)) AWT-EventQueue-0

I have installed TensorFlow and Keras successfully.
I don't know how to fix the problem?
The model can be downloaded by this link:

Thank you for your kind help.

Bests,
Emily

Michael Tamillow

unread,
Mar 22, 2021, 11:01:14 PM3/22/21
to Miaojia Lu, netlogo-users
Try to capitalize "adam" (i.e. "Adam")


--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netlogo-users/125318ae-074a-43b1-b1e5-6a2aba9ec937n%40googlegroups.com.

Miaojia Lu

unread,
Mar 23, 2021, 2:34:24 PM3/23/21
to netlogo-users
It works!
Thank you very much!

Reply all
Reply to author
Forward
0 new messages