May-09-2020, 08:16 AM
Did you use .numpy() twice?
means that the variables are already a numerical object that you can use/print directly
so delete the .numpy() or donĀ“t use it twice on the same object.
return f1.numpy(), precision.numpy(), recall.numpy() f1, precision, recall = computeMetrics([1.0, 2.0, 3.0, 4.0], [1.1, 1.9, 3.2, 4.1]) print('metrics: ', f1.numpy(), precision.numpy(), recall.numpy())AttributeError: 'numpy.float32' object has no attribute 'numpy'
means that the variables are already a numerical object that you can use/print directly
so delete the .numpy() or donĀ“t use it twice on the same object.