When I launch the project via "python main.py", I got the error message as fellowing:
Traceback (most recent call last):
File "main.py", line 29, in <module>
model = train(train_loader, test_loader)
File "/home/temporary/simu/object-detection/FastFlow/train.py", line 116, in train
if test_labels[i] == 0: # label value of good TODO eliminate magic numbers
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
The error occured in this code
# evaluate
test_loss.append(t2np(loss))
test_labels.append(t2np(labels))
test_loss_good = list()
test_loss_defective = list()
'''
Error occured Here
'''
for i in range(len(test_labels)):
if test_labels[i] == 0: # label value of good TODO eliminate magic numbers
test_loss_good.append(test_loss[i])
else:
test_loss_defective.append(-test_loss[i])
As I print the test_labels[i], I got an array like [0, 2]
So, what should I do to launch this project? Thanks!
When I launch the project via "python main.py", I got the error message as fellowing:
The error occured in this code
As I print the
test_labels[i]
, I got an array like[0, 2]
So, what should I do to launch this project? Thanks!