You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the program comparison.py in Exercise 7.2, the program reports the following error
Traceback (most recent call last):
File "D:\Download\Anaconda\envs\py39torch\lib\concurrent\futures\process.py", line 246, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "D:\Download\Anaconda\envs\py39torch\lib\concurrent\futures\process.py", line 205, in _process_chunk
return [fn(*args) for args in chunk]
File "D:\Download\Anaconda\envs\py39torch\lib\concurrent\futures\process.py", line 205, in
return [fn(*args) for args in chunk]
File "d:\Desktop\python_work\RL\RLhomework4\comparison.py", line 44, in run_pred
return test_predictor(x, **y)
File "d:\Desktop\python_work\RL\RLhomework4\comparison.py", line 35, in test_predictor
e = predictor.environment.generate_episode()
File "d:\Desktop\python_work\RL\RLhomework4\comparison.py", line 94, in generate_episode
environment.next()
NameError: name 'environment' is not defined
After a period of debugging, I found that the environment.next() in the member function generate_episode of the class RandomWalkEnvironment should be changed to self.next(). With this modification, the bug disappears.
Thanks and keep up the good work !
The text was updated successfully, but these errors were encountered:
Hello,
When I run the program comparison.py in Exercise 7.2, the program reports the following error
Traceback (most recent call last):
File "D:\Download\Anaconda\envs\py39torch\lib\concurrent\futures\process.py", line 246, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "D:\Download\Anaconda\envs\py39torch\lib\concurrent\futures\process.py", line 205, in _process_chunk
return [fn(*args) for args in chunk]
File "D:\Download\Anaconda\envs\py39torch\lib\concurrent\futures\process.py", line 205, in
return [fn(*args) for args in chunk]
File "d:\Desktop\python_work\RL\RLhomework4\comparison.py", line 44, in run_pred
return test_predictor(x, **y)
File "d:\Desktop\python_work\RL\RLhomework4\comparison.py", line 35, in test_predictor
e = predictor.environment.generate_episode()
File "d:\Desktop\python_work\RL\RLhomework4\comparison.py", line 94, in generate_episode
environment.next()
NameError: name 'environment' is not defined
After a period of debugging, I found that the environment.next() in the member function generate_episode of the class RandomWalkEnvironment should be changed to self.next(). With this modification, the bug disappears.
Thanks and keep up the good work !
The text was updated successfully, but these errors were encountered: