Lam1360 / YOLOv3-model-pruning

在 oxford hand 数据集上对 YOLOv3 做模型剪枝(network slimming)
MIT License
1.67k stars 431 forks source link

test_prune.py进行剪枝时出错,求助 #49

Open zxealous opened 5 years ago

zxealous commented 5 years ago

RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

Detecting objects: 0%| | 0/37 [00:04<?, ?it/s] Detecting objects: 0%| | 0/37 [00:00<?, ?it/s]

没找到该在哪里修改

dlam4h commented 5 years ago

添加一个if name == 'main':就可以了 官方文档

wd923923 commented 5 years ago

一样的问题,请问解决了吗

dlam4h commented 5 years ago

一样的问题,请问解决了吗

把test_prune.py里面除了import的代码全放在def main():里,然后在最下面添加 if name == 'main': main()

wd923923 commented 5 years ago

一样的问题,请问解决了吗

把test_prune.py里面除了import的代码全放在def main():里,然后在最下面添加 if name == 'main': main()

非常感谢,解决了