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

some problems when run dqn_agent.py #9

Open
larenzhang opened this issue Aug 4, 2017 · 8 comments
Open

some problems when run dqn_agent.py #9

larenzhang opened this issue Aug 4, 2017 · 8 comments

Comments

@larenzhang
Copy link

My work env:Python 3.5.2 :: Anaconda custom (64-bit),tensorflow 1.0.1,keras 2.0.4.There are some questions I have encountered.As follows:
1.File "/usr/anaconda3/lib/python3.5/site-packages/tgym/envs/init.py", line 1, in
from trading import SpreadTrading
ImportError: No module named 'trading
=>so I have to solve it by import sys and append the code sys.path.append('/usr/anaconda3/lib/python3.5/site-packages/tgym/envs/')
=>There are also analogous problems:
File "dqn_agent.py", line 118, in
from tgym.gens.deterministic import WavySignal
File "/usr/anaconda3/lib/python3.5/site-packages/tgym/gens/init.py", line 1, in
from csvstream import *
ImportError: No module named 'csvstream'
2.when I solve the problems about the module,there are also error:
=> File "/usr/anaconda3/lib/python3.5/site-packages/tgym/gens/csvstream.py", line 6
print csv
^
SyntaxError: Missing parentheses in call to 'print'
=>I have saw the codes of dqn_agent.py,it uses pytho 3.x.However,csvstream.py uses pyhton 2.x

===>Therefore ,I want to ask is there a efficient way to run the examples.I do not know how many bugs there are.Thank you!

@jam-lock
Copy link

I also had problems with the init.py files regarding imports. But after fixing them I had this error:

Traceback (most recent call last):
File "D:\FG\Machine Learning\OpenAI\CryptoTrade-Orders\DQN_Trading2.py", line 121, in
generator = WavySignal(period_1=25, period_2=50, epsilon=-0.5)
File "C:\Users\Filipe\Anaconda3\lib\site-packages\tgym\core.py", line 54, in init
self.n_products = len(self.next()) / 2
File "C:\Users\Filipe\Anaconda3\lib\site-packages\tgym\core.py", line 71, in next
return self.generator.next()
AttributeError: 'generator' object has no attribute 'next'

Looking at the code in core.py I couldn't figure out what was going wrong

@thedimlebowski
Copy link
Owner

Hi both. Thanks for reporting these issues.
I suspect the problems come from using python 3.x. We are not yet fully supporting python 3.x so I would recommend running tgym with python 2.x.

@davdigioia
Copy link

/home/dav/anaconda3/lib/python3.6/site-packages/tgym/envs/init.py in ()
----> 1 from trading import SpreadTrading

ModuleNotFoundError: No module named 'trading'

@cove9988
Copy link

Hi davdigioia

This is caused by Python 3.x. It does not support relative import any more.
you might change it to:
from tgym.envs.trading import SpreadTrading

@davdigioia
Copy link

davdigioia commented Oct 25, 2017 via email

@ckcollab
Copy link

from tgym.envs.trading import SpreadTrading doesn't work, I still get ModuleNotFoundError: No module named 'trading'

@davidefornelli
Copy link

If you are using python >= 3, comment out the content of __init__.py files:

tgym
└── envs
|    └── __init__.py
└── gens
     └── __init__.py

@TanWeeSiang
Copy link

Is this dqn agent in static mode ? cause i run th generator using live feed . it say chunk error.

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

No branches or pull requests

8 participants