google / dopamine

Dopamine is a research framework for fast prototyping of reinforcement learning algorithms.
https://github.com/google/dopamine
Apache License 2.0
10.58k stars 1.38k forks source link

question: trouble loading 'content' #33

Closed yangliu2 closed 5 years ago

yangliu2 commented 6 years ago

when loading content using experimental_data = colab_utils.load_baselines('/content') I got this error You are trying to merge on float64 and object columns. If you wish to proceed you should use pd.concat. I'm not sure what's wrong. I ran this on my local computer. I have 'c51, dqn, implicit_quantile, quantile, rainbow' in 'content' folder. Is this pandas related problem?

Jarvis-K commented 6 years ago

maybe u are using python3 run the load_baselines. the pickle file is generated by python2,when readed by python3,the dataframe columns type will be object .when merged two dataframe,pandas convert object type to float.this error is due to the second time u try to merge,the float columns cannot merge with object columns. I just pulled a new request for this problem

yangliu2 commented 6 years ago

Thanks. When will Google switch to python3? The core developer is going to retire it.

Jarvis-K commented 6 years ago

I don't know how long the team will merge my pull request.but you can just simply modify like my pull request ,then rebuild it from source use python3 setup.py install.Then you can load baselines with no errors. But by the way ,if u build from source ,then try not reference colab code to modify your own codes,cause the dopamine-rl version used in it is lower than the source,it hasn't been modified for now.

yangliu2 commented 6 years ago

I just installed python2.7 and run this. It still have the same problem. Do you have any thoughts?

psc-g commented 6 years ago

this is running on your local computer? the colab utilities have really only been tested on colab.research.google.com.

if you provide your setup and command lines used i can try to reproduce.

KaixiangLin commented 5 years ago

A quick fix:

add following lines after this line in load_statistics.ipynb: sample_data['run_number'] = 1

sample_data['run_number'] = sample_data['run_number'].astype("float64")
sample_data['iteration'] = sample_data['iteration'].astype("float64")
sample_data['train_episode_returns'] = sample_data['train_episode_returns'].astype(
    "float64")

Similarly, add following lines after this line in colab.utils.py

single_agent_data['run_number'] = single_agent_data['run_number'].astype("float64")
single_agent_data['iteration'] = single_agent_data['iteration'].astype("float64")
single_agent_data['train_episode_returns'] = single_agent_data['train_episode_returns'].astype(
                    "float64")

Then you should be able to re-plot the results.

xavigonzalvo commented 5 years ago

This problem seems to persist in a colab executed in a python2.7 framework when loading the baseline data:

experimental_data = colab_utils.load_baselines('/content')

Error is:

ValueError: You are trying to merge on float64 and object columns. If you wish to proceed you should use pd.concat
psc-g commented 5 years ago

thanks for pointing this out. i've reproduced this error on my end and have a fix that will go out soon.

psc-g commented 5 years ago

this was fixed here