Tencent / PocketFlow

An Automatic Model Compression (AutoMC) framework for developing smaller and faster AI applications.
https://pocketflow.github.io
Other
2.79k stars 490 forks source link

TypeError: forward_train() missing 1 required positional argument: 'objects' #311

Open Julius-ZCJ opened 5 years ago

Julius-ZCJ commented 5 years ago

我在使用faster_rcnn_at_pascalvoc_run.pys的时候出现了这个错误: Traceback (most recent call last): File "main.py", line 70, in tf.app.run() File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "main.py", line 51, in main learner = create_learner(sm_writer, model_helper) File "/PocketFlow/learners/learner_utils.py", line 56, in create_learner learner = DisChnPrunedLearner(sm_writer, model_helper) File "/PocketFlow/learners/discr_channel_pruning/learner.py", line 126, in init self.build_train() File "/PocketFlow/learners/discr_channel_pruning/learner.py", line 203, in __build_train = self.forward_train(images) TypeError: forward_train() missing 1 required positional argument: 'objects'

我进去查看追踪到这个函数确实有一个‘objects’参数,这个函数在faster_rcnn_at_pascalvoc.py里: def forward_train(self, inputs, objects, data_format='channels_last'): """Forward computation at training.""" inputs_dict = {'inputs': inputs, 'objects': objects} outputs = forward_fn(inputs_dict, True) self.vars = slim.get_model_variables() return outputs

这个形式和基类就是多了一个‘objects’参数: def forward_train(self, inputs, labels=None): """Forward computation at training.

Args:
* inputs: inputs to the network's forward pass
* labels: ground-truth labels

Returns:
* outputs: outputs from the network's forward pass
"""
pass

我该怎么修改这个bug? 还有就是‘objects’的结构是什么样的,我要使用自己的数据是否一定转为pascalvoc的格式,在哪里可以修改读取数据的形式?