-
Notifications
You must be signed in to change notification settings - Fork 256
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
ValueError: Data cardinality is ambiguous: #18
Comments
same issue here, saw in some tensorflow threads that its due to inputs with a different number of values, IE ohlcv and ind are different lengths, but I havent found a fix for it yet. ill keep you updated if I find something. |
so I ran it in a jupyter notebook to get a closer look at the variables and ohlcv_test has lengths of (675, 50, 5) while tech_ind_test has lengths of (675, 1) and the error is returning x size: 50, 1 so it seems to be skipping over the 675 values for both arrays and trying to compare the 50 and the 1. not sure what to do about it, but that seems to be whats happening. |
i found the problem and the fix: |
I get this error when running the trading_algo.py:
`ValueError Traceback (most recent call last)
in ()
----> 1 model.predict([[ohlcv], [ind]])
3 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/data_adapter.py in init(self, x, y, sample_weights, sample_weight_modes, batch_size, epochs, steps, shuffle, **kwargs)
280 label, ", ".join(str(i.shape[0]) for i in nest.flatten(data)))
281 msg += "Please provide data which shares the same first dimension."
--> 282 raise ValueError(msg)
283 num_samples = num_samples.pop()
284 `
ValueError: Data cardinality is ambiguous:
x sizes: 50, 1
Please provide data which shares the same first dimension.
Can anyone advise what the issue is?
The text was updated successfully, but these errors were encountered: