-
Notifications
You must be signed in to change notification settings - Fork 91
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
How fix this error? I am using NNTC_pv_LSTM + ShortTradeDurHyperOptLoss #28
Comments
Can you send me the full output please?
From what I can see here, it looks like there is an error loading the
model. Did you change anything related to the neural network algorithm or
the number of inputs?
Thanks
Phil
…On Tue, May 9, 2023 at 2:09 AM Luiz Paulo Nievola ***@***.***> wrote:
Epochs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0/1000 0% • 0:00:17 • -:--:--WARNING:tensorflow:From
/freqtrade/user_data/strategies/ClassifierKeras.py:44: The name
tf.keras.backend.set_session is deprecated. Please use
tf.compat.v1.keras.backend.set_session instead.
WARNING:tensorflow:From
/freqtrade/user_data/strategies/ClassifierKeras.py:44: The name
tf.keras.backend.set_session is deprecated. Please use
tf.compat.v1.keras.backend.set_session instead.
Epochs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0/1000 0% • 0:00:17 • -:--:--WARNING:tensorflow:From
/freqtrade/user_data/strategies/ClassifierKeras.py:44: The name
tf.keras.backend.set_session is deprecated. Please use
tf.compat.v1.keras.backend.set_session instead.
Epochs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0/1000 0% • 0:00:17 • -:--:--WARNING:tensorflow:From
/freqtrade/user_data/strategies/ClassifierKeras.py:44: The name
tf.keras.backend.set_session is deprecated. Please use
tf.compat.v1.keras.backend.set_session instead.
Epochs
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0/1000 0% • 0:00:18 • -:--:--
2023-05-08 22:19:29,633 - freqtrade - ERROR - Fatal exception!
joblib.externals.loky.process_executor._RemoteTraceback:
"""
Traceback (most recent call last):
File
"/home/ftuser/.local/lib/python3.10/site-packages/joblib/externals/loky/process_executor.py",
line 391, in _process_worker
call_item = call_queue.get(block=True, timeout=timeout)
File "/usr/local/lib/python3.10/multiprocessing/queues.py", line 122, in
get
return _ForkingPickler.loads(res)
File
"/home/ftuser/.local/lib/python3.10/site-packages/joblib/externals/loky/cloudpickle_wrapper.py",
line 43, in _reconstruct_wrapper
obj = loads(_pickled_object)
File
"/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/pickle_utils.py",
line 48, in deserialize_model_from_bytecode
raise e
File
"/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/pickle_utils.py",
line 46, in deserialize_model_from_bytecode
model = saving_lib.load_model(filepath, safe_mode=False)
File
"/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/saving_lib.py",
line 277, in load_model
raise e
File
"/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/saving_lib.py",
line 242, in load_model
model = deserialize_keras_object(
File
"/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/serialization_lib.py",
line 508, in deserialize_keras_object
instance.compile_from_config(compile_config)
File
"/home/ftuser/.local/lib/python3.10/site-packages/keras/engine/training.py",
line 3392, in compile_from_config
self.optimizer.build(self.trainable_variables)
File
"/home/ftuser/.local/lib/python3.10/site-packages/keras/optimizers/legacy/optimizer_v2.py",
line 984, in *getattribute*
raise e
File
"/home/ftuser/.local/lib/python3.10/site-packages/keras/optimizers/legacy/optimizer_v2.py",
line 974, in *getattribute*
return super().*getattribute*(name)
AttributeError: 'Adam' object has no attribute 'build'
"""
—
Reply to this email directly, view it on GitHub
<#28>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABD4X57NS64EM5B7CT22LBLXFICUDANCNFSM6AAAAAAX27W5S4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I'm using docker in oracle-cloud/ubuntu, i didn't change any party of the code. |
lmao, well there is your problem |
Hmm, it works for me.
Can you send the full output please? I especially need to see the text at
the top of the run (it shows version numbers etc.)
Also, can you run the following command please (and send me the output)?:
h5ls -r user_data/strategies/binanceus/models/NNTC_pv_LSTM/NNTC_pv_LSTM.h5
(I'm assuming you are running from the binanceus exchange, if not, change
that to the location you are using)
if you don't have h5ls installed, you can get it using the following
command:
sudo apt-get install libhdf5-dev
Thanks,
Phil
…On Wed, May 10, 2023 at 3:14 PM Luiz Paulo Nievola ***@***.***> wrote:
I'm using docker in oracle-cloud/ubuntu, i didn't change any party of the
code.
—
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABD4X525OIV4OJPKXTI7QG3XFQHMFANCNFSM6AAAAAAX27W5S4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
h5ls NNTC_pv_LSTM_ACH.h5 (base) ubuntu@bot-swarm:~/freqtrade/user_data/strategies/models/NNTC_pv_LSTM$ h5ls -r NNTC_pv_LSTM_ACH.h5 |
the model parameters look OK. Can you send me the full output of a test run
please?
You can also just generate your own model as follows - but this will take a
long time (and see notes at the end):
# remove existing models
rm -r user_data/strategies/models/NNTC_pv_LSTM
# download pair data
zsh user_data/strategies/scripts/download.sh -n 750 binanceus
# generate new model
zsh user_data/strategies/scripts/test_strat.sh -n 750 binanceus NNTC_pv_LSTM
# run hyperopt (optional, but suggested)
zsh user_data/strategies/scripts/hyp_strat.sh -n 90 -e 100 binanceus
NNTC_pv_LSTM
Notes:
- you have model_per_pair set to True. You can speed up training by setting
this to False (maybe try this with the existing model). This will then use
a single model (user_data/strategies/models/NNTC_pv_LSTM/NNTC_pv_LSTM.h5)
for all pairs
- I typically train models over ~2 years of data (750 days). If you just
want to see it runs, use a shorter time period; it will work, but just
won't be a good model
Thanks,
Phil
…On Sat, May 13, 2023 at 5:56 AM Luiz Paulo Nievola ***@***.***> wrote:
h5ls NNTC_pv_LSTM_ACH.h5
(base) ***@***.***:~/freqtrade/user_data/strategies/models/NNTC_pv_LSTM$
h5ls -r NNTC_pv_LSTM_ACH.h5
/ Group
/model_weights Group
/model_weights/dense Group
/model_weights/dense/dense Group
/model_weights/dense/dense/bias:0 Dataset {3}
/model_weights/dense/dense/kernel:0 Dataset {128, 3}
/model_weights/dropout Group
/model_weights/lstm Group
/model_weights/lstm/lstm Group
/model_weights/lstm/lstm/lstm_cell Group
/model_weights/lstm/lstm/lstm_cell/bias:0 Dataset {512}
/model_weights/lstm/lstm/lstm_cell/kernel:0 Dataset {64, 512}
/model_weights/lstm/lstm/lstm_cell/recurrent_kernel:0 Dataset {128, 512}
/model_weights/top_level_model_weights Group
/optimizer_weights Group
/optimizer_weights/Adam Group
/optimizer_weights/Adam/dense Group
/optimizer_weights/Adam/dense/bias Group
/optimizer_weights/Adam/dense/bias/m:0 Dataset {3}
/optimizer_weights/Adam/dense/bias/v:0 Dataset {3}
/optimizer_weights/Adam/dense/kernel Group
/optimizer_weights/Adam/dense/kernel/m:0 Dataset {128, 3}
/optimizer_weights/Adam/dense/kernel/v:0 Dataset {128, 3}
/optimizer_weights/Adam/iter:0 Dataset {SCALAR}
/optimizer_weights/Adam/lstm Group
/optimizer_weights/Adam/lstm/lstm_cell Group
/optimizer_weights/Adam/lstm/lstm_cell/bias Group
/optimizer_weights/Adam/lstm/lstm_cell/bias/m:0 Dataset {512}
/optimizer_weights/Adam/lstm/lstm_cell/bias/v:0 Dataset {512}
/optimizer_weights/Adam/lstm/lstm_cell/kernel Group
/optimizer_weights/Adam/lstm/lstm_cell/kernel/m:0 Dataset {64, 512}
/optimizer_weights/Adam/lstm/lstm_cell/kernel/v:0 Dataset {64, 512}
/optimizer_weights/Adam/lstm/lstm_cell/recurrent_kernel Group
/optimizer_weights/Adam/lstm/lstm_cell/recurrent_kernel/m:0 Dataset {128,
512}
/optimizer_weights/Adam/lstm/lstm_cell/recurrent_kernel/v:0 Dataset {128,
512}
—
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABD4X5YISNX2ALFYQYTIC23XF6AIFANCNFSM6AAAAAAX27W5S4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
or, if you wait a week or so, I am in the middle of re-writing parts of
NNTC and will re-generate models. It takes me about a week to generate all
the models though 😡
Thanks,
Phil
…On Sun, May 14, 2023 at 2:46 PM Phil Price ***@***.***> wrote:
the model parameters look OK. Can you send me the full output of a test
run please?
You can also just generate your own model as follows - but this will take
a long time (and see notes at the end):
# remove existing models
rm -r user_data/strategies/models/NNTC_pv_LSTM
# download pair data
zsh user_data/strategies/scripts/download.sh -n 750 binanceus
# generate new model
zsh user_data/strategies/scripts/test_strat.sh -n 750 binanceus
NNTC_pv_LSTM
# run hyperopt (optional, but suggested)
zsh user_data/strategies/scripts/hyp_strat.sh -n 90 -e 100 binanceus
NNTC_pv_LSTM
Notes:
- you have model_per_pair set to True. You can speed up training by
setting this to False (maybe try this with the existing model). This will
then use a single model
(user_data/strategies/models/NNTC_pv_LSTM/NNTC_pv_LSTM.h5) for all pairs
- I typically train models over ~2 years of data (750 days). If you just
want to see it runs, use a shorter time period; it will work, but just
won't be a good model
Thanks,
Phil
On Sat, May 13, 2023 at 5:56 AM Luiz Paulo Nievola <
***@***.***> wrote:
> h5ls NNTC_pv_LSTM_ACH.h5
>
> (base) ***@***.***:~/freqtrade/user_data/strategies/models/NNTC_pv_LSTM$
> h5ls -r NNTC_pv_LSTM_ACH.h5
> / Group
> /model_weights Group
> /model_weights/dense Group
> /model_weights/dense/dense Group
> /model_weights/dense/dense/bias:0 Dataset {3}
> /model_weights/dense/dense/kernel:0 Dataset {128, 3}
> /model_weights/dropout Group
> /model_weights/lstm Group
> /model_weights/lstm/lstm Group
> /model_weights/lstm/lstm/lstm_cell Group
> /model_weights/lstm/lstm/lstm_cell/bias:0 Dataset {512}
> /model_weights/lstm/lstm/lstm_cell/kernel:0 Dataset {64, 512}
> /model_weights/lstm/lstm/lstm_cell/recurrent_kernel:0 Dataset {128, 512}
> /model_weights/top_level_model_weights Group
> /optimizer_weights Group
> /optimizer_weights/Adam Group
> /optimizer_weights/Adam/dense Group
> /optimizer_weights/Adam/dense/bias Group
> /optimizer_weights/Adam/dense/bias/m:0 Dataset {3}
> /optimizer_weights/Adam/dense/bias/v:0 Dataset {3}
> /optimizer_weights/Adam/dense/kernel Group
> /optimizer_weights/Adam/dense/kernel/m:0 Dataset {128, 3}
> /optimizer_weights/Adam/dense/kernel/v:0 Dataset {128, 3}
> /optimizer_weights/Adam/iter:0 Dataset {SCALAR}
> /optimizer_weights/Adam/lstm Group
> /optimizer_weights/Adam/lstm/lstm_cell Group
> /optimizer_weights/Adam/lstm/lstm_cell/bias Group
> /optimizer_weights/Adam/lstm/lstm_cell/bias/m:0 Dataset {512}
> /optimizer_weights/Adam/lstm/lstm_cell/bias/v:0 Dataset {512}
> /optimizer_weights/Adam/lstm/lstm_cell/kernel Group
> /optimizer_weights/Adam/lstm/lstm_cell/kernel/m:0 Dataset {64, 512}
> /optimizer_weights/Adam/lstm/lstm_cell/kernel/v:0 Dataset {64, 512}
> /optimizer_weights/Adam/lstm/lstm_cell/recurrent_kernel Group
> /optimizer_weights/Adam/lstm/lstm_cell/recurrent_kernel/m:0 Dataset {128,
> 512}
> /optimizer_weights/Adam/lstm/lstm_cell/recurrent_kernel/v:0 Dataset {128,
> 512}
>
> —
> Reply to this email directly, view it on GitHub
> <#28 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABD4X5YISNX2ALFYQYTIC23XF6AIFANCNFSM6AAAAAAX27W5S4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
There are anything wrong with the backtest |
The results look too good, which usually means that you have something
forward-looking in your technical indicators. Did you add any?
Thanks
Phil
…On Tue, May 16, 2023 at 3:49 PM Luiz Paulo Nievola ***@***.***> wrote:
There are anything wrong with the backtest
output.txt
<https://github.com/nateemma/strategies/files/11492609/output.txt>
—
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABD4X5ZVUXDG2EL2SUFGAQTXGQABFANCNFSM6AAAAAAX27W5S4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Actually, I'm seeing really good results too. I'll see if I can track down
what's going on. You might want to try a dry run to see how it
performs against live data
Thanks,
Phil
…On Thu, May 18, 2023 at 8:53 PM Phil Price ***@***.***> wrote:
The results look too good, which usually means that you have something
forward-looking in your technical indicators. Did you add any?
Thanks
Phil
On Tue, May 16, 2023 at 3:49 PM Luiz Paulo Nievola <
***@***.***> wrote:
> There are anything wrong with the backtest
>
> output.txt
> <https://github.com/nateemma/strategies/files/11492609/output.txt>
>
> —
> Reply to this email directly, view it on GitHub
> <#28 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABD4X5ZVUXDG2EL2SUFGAQTXGQABFANCNFSM6AAAAAAX27W5S4>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
OK, I cannot find any lookahead bias. However, I notice that the returns
are extremely sensitive to the time period used. My suspicion is that the
performance is good because your training and test data overlap (i.e. you
are testing with some of the data that you also used for training). I
will take a look at excluding the last 30 days (for example) of data from
any training/verification and see how that works...
Cheers,
Phil
…On Fri, May 19, 2023 at 10:49 AM Phil Price ***@***.***> wrote:
Actually, I'm seeing really good results too. I'll see if I can track down
what's going on. You might want to try a dry run to see how it
performs against live data
Thanks,
Phil
On Thu, May 18, 2023 at 8:53 PM Phil Price ***@***.***> wrote:
> The results look too good, which usually means that you have something
> forward-looking in your technical indicators. Did you add any?
>
> Thanks
>
> Phil
>
> On Tue, May 16, 2023 at 3:49 PM Luiz Paulo Nievola <
> ***@***.***> wrote:
>
>> There are anything wrong with the backtest
>>
>> output.txt
>> <https://github.com/nateemma/strategies/files/11492609/output.txt>
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#28 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ABD4X5ZVUXDG2EL2SUFGAQTXGQABFANCNFSM6AAAAAAX27W5S4>
>> .
>> You are receiving this because you commented.Message ID:
>> ***@***.***>
>>
>
|
Hallo, I'm using: ROI: Closed trades |
I already reserve the last 20% of the specified time period for testing, so if you run backtest somewhere within that test region, you should get realistic results. I also plan (if I ever get enough free time) to try reserving even more data so that the model doesn't even see that data during training, even for validation. I have been dry running this strategy for a few days, and it's actually doing OK (up 1.43%) FYI, I am currently working on a bug fix for labelling (there was a condition where events could be tagged as both hold and sell). I am re-gnerating the models and will push as soon as that is done (probably in a few days as there are lots of models to generate) Thanks, Phil |
Epochs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/1000 0% • 0:00:17 • -:--:--WARNING:tensorflow:From /freqtrade/user_data/strategies/ClassifierKeras.py:44: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.
WARNING:tensorflow:From /freqtrade/user_data/strategies/ClassifierKeras.py:44: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.
Epochs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/1000 0% • 0:00:17 • -:--:--WARNING:tensorflow:From /freqtrade/user_data/strategies/ClassifierKeras.py:44: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.
Epochs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/1000 0% • 0:00:17 • -:--:--WARNING:tensorflow:From /freqtrade/user_data/strategies/ClassifierKeras.py:44: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.
Epochs ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/1000 0% • 0:00:18 • -:--:--
2023-05-08 22:19:29,633 - freqtrade - ERROR - Fatal exception!
joblib.externals.loky.process_executor._RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/ftuser/.local/lib/python3.10/site-packages/joblib/externals/loky/process_executor.py", line 391, in _process_worker
call_item = call_queue.get(block=True, timeout=timeout)
File "/usr/local/lib/python3.10/multiprocessing/queues.py", line 122, in get
return _ForkingPickler.loads(res)
File "/home/ftuser/.local/lib/python3.10/site-packages/joblib/externals/loky/cloudpickle_wrapper.py", line 43, in _reconstruct_wrapper
obj = loads(_pickled_object)
File "/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/pickle_utils.py", line 48, in deserialize_model_from_bytecode
raise e
File "/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/pickle_utils.py", line 46, in deserialize_model_from_bytecode
model = saving_lib.load_model(filepath, safe_mode=False)
File "/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/saving_lib.py", line 277, in load_model
raise e
File "/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/saving_lib.py", line 242, in load_model
model = deserialize_keras_object(
File "/home/ftuser/.local/lib/python3.10/site-packages/keras/saving/serialization_lib.py", line 508, in deserialize_keras_object
instance.compile_from_config(compile_config)
File "/home/ftuser/.local/lib/python3.10/site-packages/keras/engine/training.py", line 3392, in compile_from_config
self.optimizer.build(self.trainable_variables)
File "/home/ftuser/.local/lib/python3.10/site-packages/keras/optimizers/legacy/optimizer_v2.py", line 984, in getattribute
raise e
File "/home/ftuser/.local/lib/python3.10/site-packages/keras/optimizers/legacy/optimizer_v2.py", line 974, in getattribute
return super().getattribute(name)
AttributeError: 'Adam' object has no attribute 'build'
"""
The text was updated successfully, but these errors were encountered: