Hosted by
Quantum Signals
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[4], line 2
1 # Get predictions from the model
----> 2 predictions = model(torch.Tensor(input[0]))
4 # Move predictions to CPU and convert to NumPy array
5 predictions = predictions.cpu().numpy()
TypeError: 'method' object is not subscriptable
input
as a variable?# Get predictions from the model
predictions = model(torch.Tensor(input[0]))
# Move predictions to CPU and convert to NumPy array
predictions = predictions.cpu().numpy()
aqora test
but got another error.# Example input to test the model
sample_input = torch.rand((1, 10)) # Random input with 10 features
# Get predictions from the model
predictions = model(sample_input)
# Move predictions to CPU and convert to NumPy array
predictions = predictions.cpu().detach().numpy()
2
Posted by antoine •
Hi there, I am getting below error when running the notebook.
aqora test
as expected? Or do you run it using Visual Studio Code?Anyways I tried to change that part and runaqora test
but got another error.
2
Posted by hasarinduperera •
Are you running the notebook with aqora test as expected? Or do you run it using Visual Studio Code?
aqora test
worked fine on terminal. But then I tried to follow the notebook (running cell by cell). That's when I got the error.Can you quote the full error trace in the topic please?
Model output: [[1 1 2 1 2]]
Model output: [[1 1 2 1 2]]
[1 FAIL] Evaluation error
Model output: [[1 1 2 1 2]]
Traceback (most recent call last):
File "/home/personal/Documents/Personal/Documents/aqora/quantum-signals-lob/.venv/lib/python3.10/site-packages/use_case/run.py", line 32, in score
return compute_score(Tensor(solution), Tensor(original_input[1]))
File "/home/personal/Documents/Personal/Documents/aqora/quantum-signals-lob/.venv/lib/python3.10/site-packages/use_case/metrics.py", line 54, in compute_score
scores = [
File "/home/personal/Documents/Personal/Documents/aqora/quantum-signals-lob/.venv/lib/python3.10/site-packages/use_case/metrics.py", line 55, in <listcomp>
compute_metrics(truth[:, h], prediction[:, h])[cst.Metrics.F1.value]
File "/home/personal/Documents/Personal/Documents/aqora/quantum-signals-lob/.venv/lib/python3.10/site-packages/use_case/metrics.py", line 19, in compute_metrics
cr = classification_report(truth, prediction, output_dict=True, zero_division=0)
File "/home/personal/Documents/Personal/Documents/aqora/quantum-signals-lob/.venv/lib/python3.10/site-packages/sklearn/utils/_param_validation.py", line 213, in wrapper
return func(*args, **kwargs)
File "/home/personal/Documents/Personal/Documents/aqora/quantum-signals-lob/.venv/lib/python3.10/site-packages/sklearn/metrics/_classification.py", line 2626, in classification_report
y_type, y_true, y_pred = _check_targets(y_true, y_pred)
File "/home/personal/Documents/Personal/Documents/aqora/quantum-signals-lob/.venv/lib/python3.10/site-packages/sklearn/metrics/_classification.py", line 103, in _check_targets
check_consistent_length(y_true, y_pred)
File "/home/personal/Documents/Personal/Documents/aqora/quantum-signals-lob/.venv/lib/python3.10/site-packages/sklearn/utils/validation.py", line 457, in check_consistent_length
raise ValueError(
ValueError: Found input variables with inconsistent numbers of samples: [1, 32]
[2 FAIL] Evaluation error
Failed to run pipeline ERROR Oh no! Failed to run pipeline
To try and fix this, you can:
- Check the above error and try again
2
Posted by hasarinduperera •
aqora test
.aqora test
worked, but notebook did not, now after my code change, notebook does work, aqora test
is not.2
Posted by antoine •
aqora test
for now. We are currently working on integrating aqora test
with python notebook runners, but for now you will have to use aqora test
.ValueError: Found input variables with inconsistent numbers of samples: [1, 32]
sklearn
as part of their function check_consistent_length
. Have you tried to return different output in your notebook?2
Posted by hasarinduperera •
Please run your submission using aqora test for now.
aqora test
right?2
Posted by antoine •
1
Posted by hasarinduperera •
1
Posted by stubbi •