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

[bug report (loadCSV in visualize.py) #56

Open
ngcngc1 opened this issue Nov 21, 2019 · 1 comment
Open

[bug report (loadCSV in visualize.py) #56

ngcngc1 opened this issue Nov 21, 2019 · 1 comment

Comments

@ngcngc1
Copy link

ngcngc1 commented Nov 21, 2019

when using anaconda installed enviroment.yml in Window 10.
I tried training a RL agent on a specific SRL model, error happened in function 'rl_baseline/visyalize.py/loadCSV()'
error is cant load file '0.monitor.csv'

after the absolute path of CSV file was added into the function, the file could be found but the 'result' was still empty '[]'

whether this function need some changes in WIN10?

@ngcngc1
Copy link
Author

ngcngc1 commented Nov 22, 2019

i have fixed this error and the code is ok
using
for input_file in monitor_files:
t_time = pd.read_csv(input_file, skiprows=1, dtype=np.float64)["t"].values
l_l = pd.read_csv(input_file, skiprows=1)["l"].values
r_reward = pd.read_csv(input_file, skiprows=1, dtype=np.float64)["r"].values
data = np.row_stack((t_time, l_l, r_reward)).transpose()
instead of
for input_file in monitor_files:
data = []
with open(input_file, 'r') as f:
f.readlines()
f.readlines()
for line in f:
tmp = line.split(',')
t_time = float(tmp[2])
tmp = [t_time, int(tmp[1]), float(tmp[0])]
data.append(tmp)

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

1 participant