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

How fix this error? I am using NNTC_pv_LSTM + ShortTradeDurHyperOptLoss #28

Closed
maledicente opened this issue May 8, 2023 · 13 comments
Closed

Comments

@maledicente
Copy link

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'
"""

@nateemma
Copy link
Owner

nateemma commented May 10, 2023 via email

@maledicente
Copy link
Author

I'm using docker in oracle-cloud/ubuntu, i didn't change any party of the code.

@mmsquantum
Copy link

mmsquantum commented May 11, 2023

lmao, well there is your problem

@nateemma
Copy link
Owner

nateemma commented May 11, 2023 via email

@maledicente
Copy link
Author

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
/ 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}

@nateemma
Copy link
Owner

nateemma commented May 14, 2023 via email

@nateemma
Copy link
Owner

nateemma commented May 15, 2023 via email

@maledicente
Copy link
Author

There are anything wrong with the backtest

output.txt

@nateemma
Copy link
Owner

nateemma commented May 19, 2023 via email

@nateemma
Copy link
Owner

nateemma commented May 19, 2023 via email

@nateemma
Copy link
Owner

nateemma commented May 20, 2023 via email

@maledicente
Copy link
Author

Hallo,
I have seen this happen with IchiV1 and others strategy.
"excluding the last 30 days (for example) of data from
any training/verification and see how that works..." -> I do the same, 80 train / 20 test

freqtrade/freqtrade#6209

I'm using:
Mode: Dry-run
Exchange: binance
Market: spot
Stake per trade: unlimited USDT
Max open Trades: 6
Minimum ROI: {'0': 0.06}
Entry strategy: {"order_book_top": 1, "price_last_balance": 0.0, "check_depth_of_market": {"enabled": false, "bids_to_ask_delta": 1}, "price_side": "other", "use_order_book": false}
Exit strategy: {"use_order_book": false, "order_book_top": 1, "price_side": "other"}
Stoploss: -0.99
Position adjustment: Off
Timeframe: 5m
Strategy: NNTC_pv_LSTM
Current state: running


ROI: Closed trades
∙ -4.517 USDT (-0.04%) (-0.45 Σ%)
∙ -22.45 BRL
ROI: All trades
∙ -11.081 USDT (-0.10%) (-1.11 Σ%)
∙ -55.073 BRL
Total Trade Count: 68
Bot started: 2023-05-20 04:22:04
First Trade opened: 3 days ago (2023-05-20 04:30:37)
Latest Trade opened: 40 minutes ago (2023-05-23 12:10:44)
Win / Loss: 29 / 35
Avg. Duration: 5:56:25
Best Performing: ACH/USDT: 5.37%
Trading volume: 21750.449 USDT
Profit factor: 0.87
Max Drawdown: 1.86% (18.717 USDT)

@nateemma
Copy link
Owner

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%)
From the way it is trading (quick in & out), it might be better suited for a 'scalping' approach, i.e. lots of open trades for small amounts.

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

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

2 participants