WeijingShi / Point-GNN

Point-GNN: Graph Neural Network for 3D Object Detection in a Point Cloud, CVPR 2020.
MIT License
523 stars 114 forks source link

problem when training #38

Closed xiaoyuSui closed 3 years ago

xiaoyuSui commented 3 years ago

There is an error when training:

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.

I searched online and it says this is because I am running in Windows and multi-thread program(the data loading part)should be inside if name == 'main': .I tried hard but once I change a bit there comes more errors. I really can not fix it because I am such a new starter OTZ. Please help!

WeijingShi commented 3 years ago

Hi @xiaoyuSui , It seems that in Windows the new process will import the main. Could you try to insert

if __nam__ == '__main__':  

to prevent code after the following line to execute? https://github.com/WeijingShi/Point-GNN/blob/2baf24f9556907f23e2e4018f1b756dac3f6c497/train.py#L172 Let me know if this works. Thanks,

xiaoyuSui commented 3 years ago

Thank you sooooo much! It works! It is so nice of you to help me out! Actually I have tried it before but now it seems I got some other things wrong then

typhoonlee commented 3 years ago

Hi,Where did you insert this line of code? I am facing the same problem now, looking forward to your reply @xiaoyuSui

xiaoyuSui commented 3 years ago

I remember it should have worked.

if name == 'main':

model =======================================================================

if 'COPY_PER_GPU' in train_config:
    COPY_PER_GPU = train_config['COPY_PER_GPU']
else:
    COPY_PER_GPU = 1
NUM_GPU = train_config['NUM_GPU']