-
Notifications
You must be signed in to change notification settings - Fork 6.8k
TypeError: 'float' object is not subscriptable` #14468
Comments
Hey, this is the MXNet Label Bot. |
I think you can have a try with (gluon-cv)[https://github.com/dmlc/gluon-cv]. It has a better version of SSD and is more accuracy. |
@mxnet-label-bot add [Python, Example] |
I think this issue is caused by this PR#13471. This PR added the new method |
hi i have this error. why ? |
Has this issue been solved? This mainly "float-str" conversion problem. I'm facing similar problem while trying to access index[0] for a list in Python. |
As Wuxun Zhang commented, define a function reset_local() in the class MultiBoxMetric to override the new method |
Description
When I ran ssd training using this script, I got an error
TypeError: 'float' object is not subscriptable
. I tried this example on both GPU and CPU, but there always have the same problem.Environment info (Required)
Package used (Python/R/Scala/Julia):
I'm using Python.
Build info (Required if built from source)
gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
MXNet commit hash:
ed77d6d
Build config:
make USE_OPENCV=1 USE_MKLDNN=1 USE_BLAS=mkl -j
Error Message:
Traceback (most recent call last):
File "train.py", line 153, in
voc07_metric=args.use_voc07_metric)
File "/home/wuxunzha/github/incubator-mxnet/example/ssd/train/train_net.py", line 275, in train_net
monitor=monitor)
File "/home/wuxunzha/github/incubator-mxnet/python/mxnet/module/base_module.py", line 533, in fit
self.update_metric(eval_metric, data_batch.label)
File "/home/wuxunzha/github/incubator-mxnet/python/mxnet/module/module.py", line 773, in update_metric
self.exec_group.update_metric(eval_metric, labels, pre_sliced)
File "/home/wuxunzha/github/incubator-mxnet/python/mxnet/module/executor_group.py", line 639, in update_met ric
eval_metric.update_dict(labels, preds)
File "/home/wuxunzha/github/incubator-mxnet/python/mxnet/metric.py", line 133, in update_dict
self.update(label, pred)
File "/home/wuxunzha/github/incubator-mxnet/example/ssd/train/metric.py", line 57, in update
self.sum_metric[0] += (-np.log(prob + self.eps)).sum()
TypeError: 'float' object is not subscriptable
Minimum reproducible example
Just this script.
Steps to reproduce
1: cd example/ssd
2:
python train.py --pretrained /home/wuxunzha/distributed_training _lastest/ssd/pretrained/ssd_vgg16_reduced_300 --epoch 0 --gpus 0
Also you can follow this README to prepare dataset, and rerun this script.
What have you tried to solve it?
The text was updated successfully, but these errors were encountered: