Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Julius-ZCJ opened this issue Sep 17, 2019 · 0 comments

Comments

@Julius-ZCJ
Copy link

我在使用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的格式,在哪里可以修改读取数据的形式?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant