demo/auto_prune/train.py 执行报错ERROR: '>' not supported between instances of 'float' and 'method'
Created by: greatyang
$python train.py --model "MobileNet"
----------- Configuration Arguments -----------
batch_size: 256
config_file: None
data: mnist
l2_decay: 3e-05
log_period: 10
lr: 0.1
lr_strategy: piecewise_decay
model: MobileNet
momentum_rate: 0.9
num_epochs: 120
pretrained_model: ../pretrained_model/MobileNetV1_pretained
step_epochs: [30, 60, 90]
test_period: 10
total_images: 1281167
use_gpu: True
------------------------------------------------
W0710 20:56:55.537773 24805 device_context.cc:237] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 10.1, Runtime API Version: 9.2
W0710 20:56:55.541970 24805 device_context.cc:245] device: 0, cuDNN Version: 7.3.
/home/aistudio/external-libraries/paddle/fluid/executor.py:811: UserWarning: There are no operators in the program to be executed. If you pass Program manually, please use fluid.program_guard to ensure the current Program is being used.
warnings.warn(error_info)
2020-07-10 20:56:57,122-INFO: AutoPruner - base flops: 10896832.0; pruned_flops: 0.5; max_flops: 5448416.0
2020-07-10 20:56:57,122-INFO: range table: ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90])
2020-07-10 20:56:57,123-INFO: ControllerServer - listen on: [172.25.135.83:57584]
2020-07-10 20:56:57,123-INFO: Controller Server run...
2020-07-10 20:57:08,227-INFO: AutoPruner - pruned ratios: [0.33, 0.33, 0.33, 0.33, 0.33, 0.33, 0.14, 0.33, 0.33, 0.33, 0.33, 0.33, 0.33]
I0710 20:57:08.559082 24805 parallel_executor.cc:440] The Program will be executed on CUDA using ParallelExecutor, 1 cards are used, so 1 programs are executed in parallel.
I0710 20:57:08.574626 24805 build_strategy.cc:365] SeqOnlyAllReduceOps:0, num_trainers:1
I0710 20:57:08.591606 24805 parallel_executor.cc:307] Inplace strategy is enabled, when build_strategy.enable_inplace = True
I0710 20:57:08.609786 24805 parallel_executor.cc:322] Cross op memory reuse strategy is enabled, when build_strategy.memory_optimize = True or garbage collection strategy is disabled, which is not recommended
2020-07-10 20:57:08,627-INFO: epoch[0]-batch[0] - loss: 2.4930074214935303; acc_top1: 0.1171875; acc_top5: 0.578125; time: 0.07857990264892578
2020-07-10 20:57:08,869-INFO: epoch[0]-batch[10] - loss: 1.986519694328308; acc_top1: 0.33203125; acc_top5: 0.80078125; time: 0.010937929153442383
2020-07-10 20:57:09,101-INFO: epoch[0]-batch[20] - loss: 1.0187472105026245; acc_top1: 0.6171875; acc_top5: 0.96484375; time: 0.010646820068359375
2020-07-10 20:57:09,335-INFO: epoch[0]-batch[30] - loss: 0.6927857995033264; acc_top1: 0.78515625; acc_top5: 0.98046875; time: 0.010372400283813477
2020-07-10 20:57:09,564-INFO: epoch[0]-batch[40] - loss: 0.3958178162574768; acc_top1: 0.86328125; acc_top5: 0.9921875; time: 0.010392189025878906
2020-07-10 20:57:09,798-INFO: epoch[0]-batch[50] - loss: 0.38792482018470764; acc_top1: 0.87890625; acc_top5: 0.99609375; time: 0.010694742202758789
2020-07-10 20:57:10,039-INFO: epoch[0]-batch[60] - loss: 0.20835408568382263; acc_top1: 0.9296875; acc_top5: 1.0; time: 0.010483741760253906
2020-07-10 20:57:10,272-INFO: epoch[0]-batch[70] - loss: 0.18274663388729095; acc_top1: 0.94921875; acc_top5: 0.99609375; time: 0.010794401168823242
2020-07-10 20:57:10,511-INFO: epoch[0]-batch[80] - loss: 0.2166232019662857; acc_top1: 0.9375; acc_top5: 0.99609375; time: 0.010834693908691406
2020-07-10 20:57:10,742-INFO: epoch[0]-batch[90] - loss: 0.1662035882472992; acc_top1: 0.9609375; acc_top5: 1.0; time: 0.010776519775390625
2020-07-10 20:57:10,981-INFO: epoch[0]-batch[100] - loss: 0.17765462398529053; acc_top1: 0.9375; acc_top5: 1.0; time: 0.01075601577758789
2020-07-10 20:57:11,217-INFO: epoch[0]-batch[110] - loss: 0.17990663647651672; acc_top1: 0.9453125; acc_top5: 1.0; time: 0.010476827621459961
2020-07-10 20:57:11,448-INFO: epoch[0]-batch[120] - loss: 0.16300000250339508; acc_top1: 0.94140625; acc_top5: 0.99609375; time: 0.01088714599609375
2020-07-10 20:57:11,684-INFO: epoch[0]-batch[130] - loss: 0.1964532732963562; acc_top1: 0.93359375; acc_top5: 0.99609375; time: 0.010775089263916016
2020-07-10 20:57:11,915-INFO: epoch[0]-batch[140] - loss: 0.2243642508983612; acc_top1: 0.91796875; acc_top5: 1.0; time: 0.010459423065185547
2020-07-10 20:57:12,155-INFO: epoch[0]-batch[150] - loss: 0.12515389919281006; acc_top1: 0.95703125; acc_top5: 1.0; time: 0.010932683944702148
2020-07-10 20:57:12,394-INFO: epoch[0]-batch[160] - loss: 0.16398948431015015; acc_top1: 0.9453125; acc_top5: 0.99609375; time: 0.010959625244140625
2020-07-10 20:57:12,629-INFO: epoch[0]-batch[170] - loss: 0.12927889823913574; acc_top1: 0.96875; acc_top5: 1.0; time: 0.01081395149230957
2020-07-10 20:57:12,868-INFO: epoch[0]-batch[180] - loss: 0.24925950169563293; acc_top1: 0.9296875; acc_top5: 0.99609375; time: 0.010622024536132812
2020-07-10 20:57:13,100-INFO: epoch[0]-batch[190] - loss: 0.06702921539545059; acc_top1: 0.97265625; acc_top5: 1.0; time: 0.01078653335571289
2020-07-10 20:57:13,341-INFO: epoch[0]-batch[200] - loss: 0.1213417500257492; acc_top1: 0.9609375; acc_top5: 1.0; time: 0.010640382766723633
2020-07-10 20:57:13,575-INFO: epoch[0]-batch[210] - loss: 0.13785238564014435; acc_top1: 0.9609375; acc_top5: 0.98828125; time: 0.010520696640014648
2020-07-10 20:57:13,805-INFO: epoch[0]-batch[220] - loss: 0.11549228429794312; acc_top1: 0.9609375; acc_top5: 0.99609375; time: 0.010681867599487305
2020-07-10 20:57:14,040-INFO: epoch[0]-batch[230] - loss: 0.01106960978358984; acc_top1: 0.99609375; acc_top5: 1.0; time: 0.010622978210449219
2020-07-10 20:57:14,225-INFO: Eval epoch[0] batch[0] - acc_top1: 0.95703125; acc_top5: 1.0; time: 0.038498640060424805
2020-07-10 20:57:14,736-INFO: Eval epoch[0] batch[10] - acc_top1: 0.953125; acc_top5: 0.99609375; time: 0.03724551200866699
2020-07-10 20:57:15,316-INFO: Eval epoch[0] batch[20] - acc_top1: 0.984375; acc_top5: 1.0; time: 0.03789806365966797
2020-07-10 20:57:15,832-INFO: Eval epoch[0] batch[30] - acc_top1: 0.98046875; acc_top5: 1.0; time: 0.042928218841552734
2020-07-10 20:57:16,273-INFO: Final eval epoch[0] - acc_top1: 0.9678710699081421; acc_top5: 0.998730480670929
**2020-07-10 20:57:16,274-ERROR: '>' not supported between instances of 'float' and 'method'
2020-07-10 20:57:16,275-INFO: server closed!**
Traceback (most recent call last):
File "train.py", line 228, in <module>
main()
File "train.py", line 224, in main
compress(args)
File "train.py", line 209, in compress
fluid.default_main_program(), val_program)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/prune/auto_pruner.py", line 189, in prune
self._current_ratios = self._next_ratios()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/prune/auto_pruner.py", line 236, in _next_ratios
tokens = self._controller_client.next_tokens()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/common/controller_client.py", line 79, in next_tokens
socket_client.connect((self.server_ip, self.server_port))
ConnectionRefusedError: [Errno 111] Connection refused
环境如下: paddleslim 1.0.1 paddlepaddle 1.7.2 python 3.7.4