analogdevicesinc / ai8x-training

Model Training for ADI's MAX78000 and MAX78002 Edge AI Devices
Apache License 2.0
87 stars 80 forks source link

AttributeError: 'Namespace' object has no attribute 'quantize_eval' #330

Open sugspi opened 1 month ago

sugspi commented 1 month ago

Hi, I got AttributeError when I ran the below script:

python train.py --model $MODEL --dataset $DATASET--evaluate --exp-load-weights-from path-to/best.pth.tar --device MAX78002 --use-bias --compiler-mode none --confusion "$@"

Error log:

Log file for this run: path-to\logs\2024.08.18-172456\2024.08.18-172456.log
Traceback (most recent call last):
  File "path-to\ai8x-training\train.py", line 1523, in <module>
    main()
  File "path-to\ai8x-training\train.py", line 579, in main
    return evaluate_model(model, criterion, test_loader, pylogger, args, compression_scheduler)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "path-to\ai8x-training\train.py", line 1413,in evaluate_model
    if args.quantize_eval and local_rank <= 0:  # not DistributedDataParallel or rank 0
       ^^^^^^^^^^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'quantize_eval'

Could you update parsecmd.py or tell me how to avoid this error?

Marie-TK commented 3 weeks ago

Hi, I'm encountering the same issue! It seems that quantize_eval only appears on that specific line and is not defined elsewhere. It would be greatly appreciated if the development team could address this. Thank you!