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

TypeError: learn() got an unexpected keyword argument 'eval_env' #11

Open
wangjiancc opened this issue Jan 20, 2023 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@wangjiancc
Copy link

您好,试了几台电脑,也换了python版本,都是报这个错误,请教是什么原因?

[root@TD-SERVER-1 nohup]# tail -100f A2C.log
nohup: 忽略输入
train_file 文件夹已存在!
数据读取成功!
加载数据缓存
数据缓存成功!
加载数据缓存
数据缓存成功!
{'n_steps': 5, 'ent_coef': 0.01, 'learning_rate': 0.0007}
Traceback (most recent call last):
File "/data_1/bak/StockRL-main/learn/./trainer.py", line 124, in
start_train()
File "/data_1/bak/StockRL-main/learn/./trainer.py", line 119, in start_train
Trainer(model_name=options.model,
File "/data_1/bak/StockRL-main/learn/./trainer.py", line 52, in train
model.learn(total_timesteps=self.total_timesteps, tb_log_name=self.model_name, log_interval=10, reset_num_timesteps=False, eval_env=env_trade, eval_freq=1000, n_eval_episodes=10)
TypeError: learn() got an unexpected keyword argument 'eval_env'

@sunnyswag
Copy link
Owner

你应该有自己重新修改代码,和电脑及 Python 版本应该没关系,eval_env=env_trade 看一下 传进去的 env_trade 是不是符合的

@sunnyswag
Copy link
Owner

不太清楚是不是 stable_baselines3 的传参发生了变化,有具体操作的朋友可以告知一声

@sunnyswag sunnyswag added the help wanted Extra attention is needed label Mar 24, 2024
@kun2001github
Copy link

在stable-baselines3在v1.6.2之后剔除了eval_enveval_freqcreate_eval_env的用法,github说明地址:DLR-RM/stable-baselines3#925

解决方法:pip install stable-baselines3==1.2.0

@sunnyswag
Copy link
Owner

好的,谢谢你,我先控制一下版本,有空再研究升级版本之后怎么调整一下

@sunnyswag sunnyswag added enhancement New feature or request and removed help wanted Extra attention is needed labels Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants