-
Notifications
You must be signed in to change notification settings - Fork 47
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
segmentation fault with fast_cts.pyx #16
Comments
@dhfromkorea hmm, that's interesting. I've run this code on mac and ubuntu without any issue. The fast_cts code is significantly faster; I'll have to double check on the exact speedup, but I I would recommend against trying to use the pure python version. 'resize' is coming from the scikit-image library though; I wonder if there could be a problem with that installation? |
Hm... okay, so it's probably about compilation of the extension... resize' is coming from the scikit-image library though I would recommend against trying to use the pure python version. |
Can you let me know the python and library versions that you're using? |
Hi, I am using python 3.5 and cython 0.25.2. Here you can check the code: https://github.com/RL-ninja/beating-montezuma/blob/master/algorithms/paac_cts.py FYI, I have not changed the cython code at all. The error happens when I consume the code as it is. A correction: the line causing the error was not resize(). It appears having to do with
Along the call trace, the seg fault happens either in
I am in the process of setting up gdb for cython so I can trace down the error. For some reason, the seg fault error consistently occurs at a specific "factor" which is [i=1, j=26] where height and width are 42. I hope to figure out the bug (most likely my bad.. :-) asap... |
to clarify what I mean by [i=1, j=26], I do:
And I get consistently: Funny if I change the game to Breakout, I get, again, consistently: |
Hi, I got it fixed. The problem was the state (game screen image) came as being of a uint8 type... and I just had to convert it to float64. Thanks for bearing the stupid question. Thanks again for your advice and insight! UPDATE: with fast_cts, I am getting 272.2787954246189 steps/s avg. (with 4-frame skipping) This still feels very slow, compared to what I normally get without cts: 2000 steps/s. Do you have any thought how we can make this even faster? (e.g. running on a GPU) |
@dhfromkorea I could imagine parallelizing the per-pixel CTS model updates, but as there are really no matrix operations going on I'm not sure that running it on a GPU would be a huge help. On my system I found that the Double DQN updates were actually a more significant bottleneck than the density model updates. If you comment out the density model update in my implementation what sort of performance do you get? Also, sorry for the delay-- I've been travelling and haven't had much time on my computer before ICML |
Hi Steve, I feel like asking you another newbie question.
I am having a hard time running fast_cts module. I think I successfully compiled the cython module, but when using the module (fast_cts), I get a Segmentation Fault error. I tracked down to see which line causes it in fast_cts.pyx:
It's the line marked with "# the line below" and the error occurs precisely when the resized output gets assigned to obs variable. This is my first time dealing with Cython so I am not so sure whether the error has to do with:
a) the Cython compilation (Ubuntu 16.04 LTS)
or
b) the Cython code itself (since it's segmentation fault, it must have to do with memory)
Let me know if you need more specific details to share any advice.
Plus, could I ask what percentage of speedup you achieved with fast_cts, compared to the original cts? With the original cts, I get 64 timesteps / second...
Thanks.
The text was updated successfully, but these errors were encountered: