PacktPublishing / Deep-Reinforcement-Learning-Hands-On

Hands-on Deep Reinforcement Learning, published by Packt
MIT License
2.81k stars 1.28k forks source link

chapter 8: “train_model.py” running failure issue #68

Open GuilinF opened 4 years ago

GuilinF commented 4 years ago

i am running the chapter 8 example. i use the argparse "python train_model.py --year 16 -r RUN"; The "train_model.py” is failure to run by the issue:

Traceback (most recent call last): File "train_model.py", line 95, in buffer.populate(1) File "D:\Anaconda3\lib\site-packages\ptan\experience.py", line 365, in populate entry = next(self.experience_source_iter) File "D:\Anaconda3\lib\site-packages\ptan\experience.py", line 173, in iter for exp in super(ExperienceSourceFirstLast, self).iter(): File "D:\Anaconda3\lib\site-packages\ptan\experience.py", line 53, in iter obs = env.reset() File "D:\Anaconda3\lib\site-packages\gym\wrappers\time_limit.py", line 25, in reset return self.env.reset(**kwargs) File "D:\pythoncode\Deep-Reinforcement-Learning-Hands-On\Deep-Reinforcement-Learning-Hands-On-master\Chapter08\lib\environ.py", line 302, in reset self._instrument = self.np_random.choice(list(self._prices.keys())) File "mtrand.pyx", line 1126, in mtrand.RandomState.choice ValueError: a must be non-empty

please help me. thanks for your advices

Shmuma commented 4 years ago

Looks like you data is empty. Have you checked that --year arg has proper value?

GuilinF commented 4 years ago

Looks like you data is empty. Have you checked that --year arg has proper value?

yes, i find this empty issue. After read the book,i doesn't find the example argparse just like "python train_model.py --year 16 -r RUN" . So i have the question what is the proper value of --year arg this code?