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

Google colab Segmentation Fault Error after -!python cli.py optimize - command cell #129

Open
glikoz opened this issue Jul 26, 2019 · 6 comments

Comments

@glikoz
Copy link

glikoz commented Jul 26, 2019

I am newbie. I'm trying to use colab to execute your code.
I'm getting this result after: !python cli.py optimize command.
Thanks for help.

WARNING: Logging before flag parsing goes to stderr. 2019-07-25 22:41:31,271 - __main__ - initialize_data - DEBUG - Initialized Features: ['Date', 'Open', 'High', 'Low', 'Close', 'Volume'] WARNING: Logging before flag parsing goes to stderr. 2019-07-25 22:41:31,273 - __main__ - initialize_data - DEBUG - Initialized Features: ['Date', 'Open', 'High', 'Low', 'Close', 'Volume'] [I 2019-07-25 22:42:23,556] Using an existing study with name 'PPO2__MlpLnLstmPolicy__IncrementalProfit' instead of creating a new one. [I 2019-07-25 22:42:23,558] Using an existing study with name 'PPO2__MlpLnLstmPolicy__IncrementalProfit' instead of creating a new one. 2019-07-25 22:42:23,567 - __main__ - initialize_optuna - DEBUG - Initialized Optuna: 2019-07-25 22:42:23,569 - __main__ - initialize_optuna - DEBUG - Initialized Optuna: 2019-07-25 22:42:25,040 - __main__ - initialize_optuna - DEBUG - Best reward in (556) trials: -599.3695253077894 2019-07-25 22:42:25,040 - __main__ - __init__ - DEBUG - Initialize RLTrader: PPO2__MlpLnLstmPolicy__IncrementalProfit 2019-07-25 22:42:25,094 - __main__ - initialize_optuna - DEBUG - Best reward in (556) trials: -599.3695253077894 2019-07-25 22:42:25,094 - __main__ - __init__ - DEBUG - Initialize RLTrader: PPO2__MlpLnLstmPolicy__IncrementalProfit [W 2019-07-25 23:01:28,946] Setting status of trial#557 as TrialState.FAIL because of the following error: ValueError('The provided tag was already used for this event type',) Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/optuna/study.py", line 468, in _run_trial result = func(trial) File "/content/drive/My Drive/python/BTC1/lib/RLTrader.py", line 153, in optimize_params model.learn(n_steps_per_eval) File "/usr/local/lib/python3.6/dist-packages/stable_baselines/ppo2/ppo2.py", line 307, in learn writer=writer, states=mb_states)) File "/usr/local/lib/python3.6/dist-packages/stable_baselines/ppo2/ppo2.py", line 245, in _train_step writer.add_run_metadata(run_metadata, 'step%d' % (update * update_fac)) File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/summary/writer/writer.py", line 264, in add_run_metadata raise ValueError("The provided tag was already used for this event type") ValueError: The provided tag was already used for this event type 2019-07-25 23:01:38,359 - __main__ - optimize - INFO - Finished trials: 558 2019-07-25 23:01:38,633 - __main__ - optimize - INFO - Best trial: -599.3695253077894 2019-07-25 23:01:38,633 - __main__ - optimize - INFO - Params: 2019-07-25 23:01:38,895 - __main__ - optimize - INFO - cliprange: 0.13144434574199731 2019-07-25 23:01:38,895 - __main__ - optimize - INFO - ent_coef: 6.845011861174882e-05 2019-07-25 23:01:38,895 - __main__ - optimize - INFO - gamma: 0.9686739342197893 2019-07-25 23:01:38,895 - __main__ - optimize - INFO - lam: 0.8772703435238995 2019-07-25 23:01:38,895 - __main__ - optimize - INFO - learning_rate: 0.005528318256310889 2019-07-25 23:01:38,895 - __main__ - optimize - INFO - n_steps: 311.0406063281854 2019-07-25 23:01:38,896 - __main__ - optimize - INFO - noptepochs: 1.0591429310422293 **[b6a85346cae0:00495] *** Process received signal *** **[b6a85346cae0:00495] Signal: Segmentation fault (11) [b6a85346cae0:00495] Signal code: Address not mapped (1) [b6a85346cae0:00495] Failing at address: 0x7fe8fd4a220d [b6a85346cae0:00495] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fe900757890] [b6a85346cae0:00495] [ 1] /lib/x86_64-linux-gnu/libc.so.6(getenv+0xa5)[0x7fe900396785] [b6a85346cae0:00495] [ 2] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(_ZN13TCMallocGuardD1Ev+0x34)[0x7fe900c01e44] [b6a85346cae0:00495] [ 3] /lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0xf5)[0x7fe900397615] [b6a85346cae0:00495] [ 4] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(+0x13cb3)[0x7fe900bffcb3] [b6a85346cae0:00495] *** End of error message ******* WARNING: Logging before flag parsing goes to stderr. 2019-07-25 23:01:49,494 - __main__ - initialize_data - DEBUG - Initialized Features: ['Date', 'Open', 'High', 'Low', 'Close', 'Volume'] [I 2019-07-25 23:02:28,755] Using an existing study with name 'PPO2__MlpLnLstmPolicy__IncrementalProfit' instead of creating a new one. 2019-07-25 23:02:28,763 - __main__ - initialize_optuna - DEBUG - Initialized Optuna: 2019-07-25 23:02:30,123 - __main__ - initialize_optuna - DEBUG - Best reward in (558) trials: -599.3695253077894 2019-07-25 23:02:30,255 - __main__ - __init__ - DEBUG - Initialize RLTrader: PPO2__MlpLnLstmPolicy__IncrementalProfit [b6a85346cae0:00956] *** Process received signal *** [b6a85346cae0:00956] Signal: Segmentation fault (11) [b6a85346cae0:00956] Signal code: Address not mapped (1) [b6a85346cae0:00956] Failing at address: 0x7f316882a20d [b6a85346cae0:00956] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7f316badf890] [b6a85346cae0:00956] [ 1] /lib/x86_64-linux-gnu/libc.so.6(getenv+0xa5)[0x7f316b71e785] [b6a85346cae0:00956] [ 2] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(_ZN13TCMallocGuardD1Ev+0x34)[0x7f316bf89e44] [b6a85346cae0:00956] [ 3] /lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0xf5)[0x7f316b71f615] [b6a85346cae0:00956] [ 4] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(+0x13cb3)[0x7f316bf87cb3] [b6a85346cae0:00956] *** End of error message ***

@cyberslam
Copy link

My Colab install was successful:

....
Successfully built optuna ta empyrical quantstats alembic yfinance Mako idna-ssl pyperclip
Installing collected packages: pbr, stevedore, pyperclip, colorama, cmd2, cliff, colorlog, Mako, python-editor, alembic, optuna, ta, statsmodels, empyrical, multidict, yarl, pycares, aiodns, async-timeout, typing-extensions, idna-ssl, aiohttp, asn1crypto, cryptography, ccxt, configparser, yfinance, quantstats, tensorflow-gpu
Found existing installation: statsmodels 0.10.0
Uninstalling statsmodels-0.10.0:
Successfully uninstalled statsmodels-0.10.0
Successfully installed Mako-1.0.14 aiodns-1.1.1 aiohttp-3.5.4 alembic-1.0.11 asn1crypto-0.24.0 async-timeout-3.0.1 ccxt-1.18.988 cliff-2.15.0 cmd2-0.9.15 colorama-0.4.1 colorlog-4.0.2 configparser-3.7.4 cryptography-2.7 empyrical-0.5.0 idna-ssl-1.1.0 multidict-4.5.2 optuna-0.13.0 pbr-5.4.1 pycares-3.0.0 pyperclip-1.7.0 python-editor-1.0.4 quantstats-0.0.17 statsmodels-0.10.0rc2 stevedore-1.30.1 ta-0.4.5 tensorflow-gpu-1.14.0 typing-extensions-3.7.4 yarl-1.1.0 yfinance-0.1.43

then I used the following command to launch "optimize":

!python ./cli.py optimize

the following was the last bit of the error print-out:

.....
.....


| approxkl | 1.2992781e-15 |
| clipfrac | 0.0 |
| ep_rewmean | nan |
| eplenmean | nan |
| explained_variance | 0.00413 |
| fps | 14 |
| nupdates | 17 |
| policy_entropy | 0.0051370724 |
| policy_loss | 7.4659073e-07 |
| serial_timesteps | 5950 |
| time_elapsed | 352 |
| total_timesteps | 5950 |
| value_loss | 0.00065950956 |


| approxkl | 0.0 |
| clipfrac | 0.0 |
| ep_rewmean | nan |
| eplenmean | nan |
| explained_variance | -0.00316 |
| fps | 15 |
| nupdates | 15 |
| policy_entropy | 2.776626e-09 |
| policy_loss | -4.196167e-07 |
| serial_timesteps | 5625 |
| time_elapsed | 326 |
| total_timesteps | 5625 |
| value_loss | 0.0054322067 |

2019-07-28 00:23:04,076 - main - optimize_params - INFO - Pruning trial for not making any trades: 1
[I 2019-07-28 00:23:04,076] Setting status of trial#552 as TrialState.PRUNED.
2019-07-28 00:23:09,920 - main - optimize - INFO - Finished trials: 554
2019-07-28 00:23:10,169 - main - optimize - INFO - Best trial: -57.909999999999854
2019-07-28 00:23:10,170 - main - optimize - INFO - Params:
2019-07-28 00:23:10,468 - main - optimize - INFO - cliprange: 0.14951451376750177
2019-07-28 00:23:10,468 - main - optimize - INFO - ent_coef: 8.755803215177085e-06
2019-07-28 00:23:10,469 - main - optimize - INFO - gamma: 0.9024819584559397
2019-07-28 00:23:10,469 - main - optimize - INFO - lam: 0.8627452728582746
2019-07-28 00:23:10,469 - main - optimize - INFO - learning_rate: 0.0617342341331879
2019-07-28 00:23:10,469 - main - optimize - INFO - n_steps: 241.9399431970005
2019-07-28 00:23:10,469 - main - optimize - INFO - noptepochs: 14.955931188308773
[79d169cd1242:09793] *** Process received signal ***
[79d169cd1242:09793] Signal: Segmentation fault (11)
[79d169cd1242:09793] Signal code: Address not mapped (1)
[79d169cd1242:09793] Failing at address: 0x7fc383fe220d
[79d169cd1242:09793] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fc386c8c890]
[79d169cd1242:09793] [ 1] /lib/x86_64-linux-gnu/libc.so.6(getenv+0xa5)[0x7fc3868cb785]
[79d169cd1242:09793] [ 2] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(_ZN13TCMallocGuardD1Ev+0x34)[0x7fc387136e44]
[79d169cd1242:09793] [ 3] /lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0xf5)[0x7fc3868cc615]
[79d169cd1242:09793] [ 4] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(+0x13cb3)[0x7fc387134cb3]
[79d169cd1242:09793] *** End of error message ***

| approxkl | 0.0 |
| clipfrac | 0.0 |
| ep_rewmean | nan |
| eplenmean | nan |
| explained_variance | 0.0134 |
| fps | 19 |
| nupdates | 16 |
| policy_entropy | 3.3155612e-09 |
| policy_loss | -6.1670937e-07 |
| serial_timesteps | 6000 |
| time_elapsed | 350 |
| total_timesteps | 6000 |
| value_loss | 0.00019280183 |

2019-07-28 00:23:28,090 - main - optimize_params - INFO - Pruning trial for not making any trades: 1
[I 2019-07-28 00:23:28,090] Setting status of trial#553 as TrialState.PRUNED.
2019-07-28 00:23:31,960 - main - optimize - INFO - Finished trials: 554
2019-07-28 00:23:32,134 - main - optimize - INFO - Best trial: -57.909999999999854
2019-07-28 00:23:32,134 - main - optimize - INFO - Params:
2019-07-28 00:23:32,308 - main - optimize - INFO - cliprange: 0.14951451376750177
2019-07-28 00:23:32,308 - main - optimize - INFO - ent_coef: 8.755803215177085e-06
2019-07-28 00:23:32,308 - main - optimize - INFO - gamma: 0.9024819584559397
2019-07-28 00:23:32,308 - main - optimize - INFO - lam: 0.8627452728582746
2019-07-28 00:23:32,308 - main - optimize - INFO - learning_rate: 0.0617342341331879
2019-07-28 00:23:32,308 - main - optimize - INFO - n_steps: 241.9399431970005
2019-07-28 00:23:32,308 - main - optimize - INFO - noptepochs: 14.955931188308773
[79d169cd1242:09792] *** Process received signal ***
[79d169cd1242:09792] Signal: Segmentation fault (11)
[79d169cd1242:09792] Signal code: Address not mapped (1)
[79d169cd1242:09792] Failing at address: 0x7ff93680320d
[79d169cd1242:09792] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7ff9394ad890]
[79d169cd1242:09792] [ 1] /lib/x86_64-linux-gnu/libc.so.6(getenv+0xa5)[0x7ff9390ec785]
[79d169cd1242:09792] [ 2] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(_ZN13TCMallocGuardD1Ev+0x34)[0x7ff939957e44]
[79d169cd1242:09792] [ 3] /lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0xf5)[0x7ff9390ed615]
[79d169cd1242:09792] [ 4] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(+0x13cb3)[0x7ff939955cb3]
[79d169cd1242:09792] *** End of error message ***
WARNING: Logging before flag parsing goes to stderr.
2019-07-28 00:23:36,255 - main - initialize_data - DEBUG - Initialized Features: ['Date', 'Open', 'High', 'Low', 'Close', 'Volume']
[I 2019-07-28 00:24:12,288] Using an existing study with name 'PPO2__MlpLnLstmPolicy__IncrementalProfit' instead of creating a new one.
2019-07-28 00:24:12,292 - main - initialize_optuna - DEBUG - Initialized Optuna:
2019-07-28 00:24:13,278 - main - initialize_optuna - DEBUG - Best reward in (554) trials: -57.909999999999854
2019-07-28 00:24:13,407 - main - init - DEBUG - Initialize RLTrader: PPO2__MlpLnLstmPolicy__IncrementalProfit
[79d169cd1242:09990] *** Process received signal ***
[79d169cd1242:09990] Signal: Segmentation fault (11)
[79d169cd1242:09990] Signal code: Address not mapped (1)
[79d169cd1242:09990] Failing at address: 0x7fe6bc31520d
[79d169cd1242:09990] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fe6befbf890]
[79d169cd1242:09990] [ 1] /lib/x86_64-linux-gnu/libc.so.6(getenv+0xa5)[0x7fe6bebfe785]
[79d169cd1242:09990] [ 2] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(_ZN13TCMallocGuardD1Ev+0x34)[0x7fe6bf469e44]
[79d169cd1242:09990] [ 3] /lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0xf5)[0x7fe6bebff615]
[79d169cd1242:09990] [ 4] /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4(+0x13cb3)[0x7fe6bf467cb3]
[79d169cd1242:09990] *** End of error message ***

@glikoz
Copy link
Author

glikoz commented Jul 29, 2019

This is exactly same error, I hope someone can explain the reason behind it.

@cyberslam
Copy link

cyberslam commented Aug 8, 2019 via email

@zhouti29
Copy link

zhouti29 commented Aug 8, 2019

Hi Samuel, I have the same segmentation fault error after running the script for a while. That's why I deleted my solution posted earlier. Now I am running the RL on my local machine. Sorry to give you the misleading information.

@cyberslam
Copy link

cyberslam commented Aug 8, 2019 via email

@cyberslam
Copy link

cyberslam commented Aug 8, 2019 via email

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

3 participants