Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to run the code #34

Closed
Nicolas99-9 opened this issue Jan 31, 2018 · 2 comments
Closed

Problem to run the code #34

Nicolas99-9 opened this issue Jan 31, 2018 · 2 comments

Comments

@Nicolas99-9
Copy link

I have a problem to run the code, after the first epoch, I call the function env.reset() to start a new one but I have the following error :

WARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>. Please provide explicit dtype.
WARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>. Please provide explicit dtype.
WARN: Environment '<class 'btgym.envs.backtrader.BTgymEnv'>' has deprecated methods. Compatibility code invoked.
learning-rules.py:320: RuntimeWarning: overflow encountered in multiply
self.states = self.states+ learning_rateestimated_valuetraces
learning-rules.py:320: RuntimeWarning: invalid value encountered in multiply
self.states = self.states+ learning_rateestimated_valuetraces
learning-rules.py:320: RuntimeWarning: invalid value encountered in add
self.states = self.states+ learning_rateestimated_valuetraces
Episode 1 finished
/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/lines.py:44: MatplotlibDeprecationWarning: The is_string_like function was deprecated in version 2.1.
if is_string_like(style) and is_hashable(style):
/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/style/core.py:92: MatplotlibDeprecationWarning: The is_string_like function was deprecated in version 2.1.
if cbook.is_string_like(style) or hasattr(style, 'keys'):
/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/style/core.py:99: MatplotlibDeprecationWarning: The is_string_like function was deprecated in version 2.1.
if not cbook.is_string_like(style):
/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/font_manager.py:971: MatplotlibDeprecationWarning: The is_string_like function was deprecated in version 2.1.
if is_string_like(family):
/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/font_manager.py:697: MatplotlibDeprecationWarning: The is_string_like function was deprecated in version 2.1.
if is_string_like(family):
/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/text.py:218: MatplotlibDeprecationWarning: The is_string_like function was deprecated in version 2.1.
elif is_string_like(fontproperties):
Process BTgymServer-2:
Traceback (most recent call last):
File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/home/nicolas/Documents/trading/btgym/btgym/server.py", line 453, in run
episode = cerebro.run(stdstats=True, preload=False, oldbuysell=True)[0]
File "/usr/local/lib/python3.5/dist-packages/backtrader/cerebro.py", line 1127, in run
runstrat = self.runstrategies(iterstrat)
File "/usr/local/lib/python3.5/dist-packages/backtrader/cerebro.py", line 1295, in runstrategies
self._runnext(runstrats)
File "/usr/local/lib/python3.5/dist-packages/backtrader/cerebro.py", line 1626, in _runnext
strat._next()
File "/usr/local/lib/python3.5/dist-packages/backtrader/strategy.py", line 328, in _next
self._next_analyzers(minperstatus)
File "/usr/local/lib/python3.5/dist-packages/backtrader/strategy.py", line 362, in _next_analyzers
analyzer._next()
File "/usr/local/lib/python3.5/dist-packages/backtrader/analyzer.py", line 188, in _next
self.next()
File "/home/nicolas/Documents/trading/btgym/btgym/server.py", line 158, in next
self.early_stop()
File "/home/nicolas/Documents/trading/btgym/btgym/server.py", line 80, in early_stop
self.render.render(self.render_at_stop, step_to_render=self.step_to_render, send_img=False)
File "/home/nicolas/Documents/trading/btgym/btgym/rendering/renderer.py", line 284, in render
xlabel=self.render_xlabel,
File "/home/nicolas/Documents/trading/btgym/btgym/rendering/renderer.py", line 312, in draw_plot
self.plt.title(title)
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/pyplot.py", line 1465, in title
return gca().set_title(s, *args, **kwargs)
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/pyplot.py", line 950, in gca
return gcf().gca(**kwargs)
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/figure.py", line 1369, in gca
return self.add_subplot(1, 1, 1, **kwargs)
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/figure.py", line 1021, in add_subplot
a = subplot_class_factory(projection_class)(self, *args, **kwargs)
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/axes/_subplots.py", line 73, in init
self._axes_class.init(self, fig, self.figbox, **kwargs)
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/axes/_base.py", line 529, in init
self._init_axis()
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/axes/_base.py", line 622, in _init_axis
self.xaxis = maxis.XAxis(self)
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/axis.py", line 676, in init
self.cla()
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/axis.py", line 760, in cla
self.reset_ticks()
File "/home/nicolas/.local/lib/python3.5/site-packages/matplotlib/axis.py", line 771, in reset_ticks
cbook.popall(self.majorTicks)
AttributeError: module 'matplotlib.cbook' has no attribute 'popall'
Traceback (most recent call last):
File "learning-rules.py", line 335, in
q.learning(env)
File "learning-rules.py", line 304, in learning
current_state = env.reset()
File "/home/nicolas/Documents/trading/btgym/btgym/envs/backtrader.py", line 595, in _reset
if self._force_control_mode():
File "/home/nicolas/Documents/trading/btgym/btgym/envs/backtrader.py", line 509, in _force_control_mode
self.server_response = self.socket.recv_pyobj()
File "/home/nicolas/.local/lib/python3.5/site-packages/zmq/sugar/socket.py", line 491, in recv_pyobj
msg = self.recv(flags)
File "zmq/backend/cython/socket.pyx", line 693, in zmq.backend.cython.socket.Socket.recv
File "zmq/backend/cython/socket.pyx", line 727, in zmq.backend.cython.socket.Socket.recv
File "zmq/backend/cython/socket.pyx", line 150, in zmq.backend.cython.socket._recv_copy
File "zmq/backend/cython/socket.pyx", line 145, in zmq.backend.cython.socket._recv_copy
File "zmq/backend/cython/checkrc.pxd", line 19, in zmq.backend.cython.checkrc._check_rc
zmq.error.Again: Resource temporarily unavailable

@Kismuz
Copy link
Owner

Kismuz commented Jan 31, 2018

@Nicolas99-9,

  1. Seems you have matplotlib 2.1 installed, see: https://github.com/Kismuz/btgym#-current-issues-and-limitations and AttributeError: 'FigureCanvasAgg' object has no attribute 'renderer' / ValueError: Axis limits cannot be NaN or Inf #19
  2. Deprecation warnings (not critical) )are due to gym changes made 25.01.18; will sort it out soon.

@Kismuz
Copy link
Owner

Kismuz commented Jan 31, 2018

changes been made to remove deprecation warnings, update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants