FinRL tutorial multicrypto_trading error while executing Training part - finrl

Here I want to use FinRL for crypto trading, while testing the FinRL's Crypto trading tutorial, bunch of error emerging. The environment I use is google colab, first problem is that the DRLAgent importing, finally I found the problem is version mismatch, so I keep testing, after days and nights, adjusting so many version, I face a error can't be solved. When the tutorial comes to training part
train(start_date=TRAIN_START_DATE,
end_date=TRAIN_END_DATE,
ticker_list=TICKER_LIST,
data_source='binance',
time_interval='5m',
technical_indicator_list=INDICATORS,
drl_lib='elegantrl',
env=env,
model_name='ppo',
current_working_dir='./test_ppo',
erl_params=ERL_PARAMS,
break_step=5e4,
if_vix=False
)
it indicate the line of if_vix error, assert error, so I try to modify the git clone version, but I can't adjust some of the package's version, so I gave up and asking for help
here is the colab I use: https://colab.research.google.com/drive/1Ro63lSqsH4IaLkVrHOH7XcNRM5tnY_Z-
sorry for my poor english and thanks for helping!!
package altering but
!pip install git+
can't change version
and the package inside the git also not anchored
also facing assert error, bunch of capability problem

Related

How to stop the PNG warning: iCCP: known incorrect sRGB profile printing to console?

I am trying to run some code which cannot be altered in functionality, but it would be great if I can somehow ignore the warnings or prevent them from being printed to the console, as it congests it and makes it unreadable. Thank you.
You can try tf.autograph.set_verbosity it's used to control how much info tensorflow logs as indicated in their docs for TF2.6
tf.autograph.set_verbosity(
level=0, alsologtostdout=False
)
Check also the answers here which covers solutions for multiple versions of tensorflow and python.

Unexpected keyword argument 'show_dtype'

I am trying to plot my model with the data types with the following the code:
plot_model(model, to_file='model/model.png', show_dtype=True, show_shapes=True, show_layer_names=True)
However, I get an error that show_dtype is not an acceptable parameter even though it appears on the TensorFlow documentation: https://www.tensorflow.org/api_docs/python/tf/keras/utils/plot_model
This is the first time that I have run into this issue. It seems that this may be due to having an earlier release if you downloaded it from Anaconda Forge rather than something else like Pip. It is a simple fix, however.
Basically, you need to go into the library source file and edit it to the current version that is shown on the TensorFlow documentation page.
The link to the GitHub page that you will copy the Python code from is here: https://github.com/tensorflow/tensorflow/blob/v2.5.0/tensorflow/python/keras/utils/vis_utils.py#L278-L348
Afterwards, head to your library path and paste that Python code there.
For example, my path is the following: C:/ProgramData/Anaconda3/envs/ml/Lib/site-packages/tensorflow/python/keras/utils/vis_utils.py. Yours should be something similar.

Error using update_struct function in TensorFlow Federated

I'm attempting to run the Minimal Stand-Alone Implementation of Federated Averaging from the TensorFlow Federated GitHub repository but receiving the following error in the server_update function:
AttributeError: module 'tensorflow_federated.python.common_libs.structure' has no attribute 'update_struct'
I have some old TensorFlow Federated code that uses the update_state function from the tff.utils package in place of update_struct() but according to a commit on GitHub this package is empty now. I'm using TensorFlow Federated version 0.18.0 and I also had the same problem trying on Google CoLab.
My question is how can I fix this error?
Thanks, any help appreciated.
I am assuming you hit the error you describe here.
It seems that the symbol is not in the 0.18 release. You can either depend on the nightly version (pip install tensorflow-federated-nightly), or modify the line to construct the new object directly, instead of using the update_struct helper. That is, the linked command could change to:
return ServerState(model_weights,
server_optimizer.variables(),
server_state.round_num + 1))

How do I specify a "toolchain_identifier" when building tensorflow from source

I am building tensorflow from source in order to use the GPU version with an older card with a compute capability of 3.0.
When building, I get an error:
ERROR: /home/[user]/.cache/bazel/_bazel_[user]/35191c369325bea6db75133a187a58d6/external/local_config_cc/BUILD:57:1: in cc_toolchain rule #local_config_cc//:cc-compiler-k8: Error while selecting cc_toolchain: Toolchain identifier 'local' was not found, valid identifiers are [local_linux, local_darwin, local_windows]
I worked around this by hand editing ~/.cache/bazel/_bazel_[user]/35191c369325bea6db75133a187a58d6/external/local_config_cc/BUILD
to change the toolchain_identifier from "local" to "local_linux" under cc_toolchain.
With that change, everything compiles. But, that seems unconventional to me.
Is there something should be specifying elsewhere so that bazel gets the identifier correct on its own?
open /home/[user]/.cache/bazel/_bazel_jeff/35191c369325bea6db75133a187a58d6/external/local_config_cc/BUILD with any text editor and change the line 57 as local_linux
Not sure this is related but ... I was having the same problem, tried a bunch of things that did not work, including alternating between clang and gcc, and then told configure I was using cudnn 7.2 instead of just 7 and it worked after that.
I got the same error in building tensorflow r1.9 for one older Nvidia GPU card. I downgraded the bazel from 0.19.1 to 0.18.1. The error was fixed in compiling.

CasperJS not finding file that is clearly there

This actually originally generated from a problem I was having running SpookyJS, but managed to nail it down to a problem with the underlying CasperJS (and based on another stackoverflow question I was directed to, possibly even a PhantomJS problem).
We determined that the command CasperJS was failing on was:
casperjs C:\wwwroot\dra\node_modules\spooky\lib\bootstrap.js --spooky_lib=C:\wwwroot\dra\node_modules\spooky\lib\ --command=casperjs --port=8081 --transport=stdio
Which generates the following:
{"jsonrpc":"2.0","method":"emit","params":["error","CasperError: CasperJS couldn't find module C:\\wwwroot\\dra\\node_modules\\spooky\\lib\\bootstrap\\stdio-server",[{"file":"C:\\casperjs\\n1k0-casperjs-bc0da16\\batchbin\\..\\bin\\bootstrap.js","line":133,"function":"_require"},{"file":"C:\\wwwroot\\dra\\node_modules\\spooky\\lib\\bootstrap.js","line":34,"function":""}]]}
At first I thought the fact that it was generating double slashes was an issue, but I've since learned that that's simply the way it spits it out. It simply can't find the file. I've tried to reference the file a few different ways, but to no avail. And, yes, the file is most definitely there. It's looking for stdio-server.js which is exactly where it's looking for it. It's also not specific to this file. In the course of my testing, I commented out that line and it failed three lines later, in the same fashion, looking for a different file.
I'm using:
CasperJS 1.0.2
PhantomJS 1.9.0
I'm desperate to get this working (preferably today since I have to demo it to my boss), so if anyone has any input on this I'd be MOST appreciative!
Thank you.
You should be able to fix this by upgrading PhantomJS to 1.9.1
Here are links to the CasperJS issue and the PhantomJS issue regarding this problem.