layumi / Person_reID_baseline_pytorch

:bouncing_ball_person: Pytorch ReID: A tiny, friendly, strong pytorch implement of person re-id / vehicle re-id baseline. Tutorial 👉https://github.com/layumi/Person_reID_baseline_pytorch/tree/master/tutorial
https://www.zdzheng.xyz
MIT License
4.09k stars 1.01k forks source link

In train.py file #188

Open ssbilakeri opened 4 years ago

ssbilakeri commented 4 years ago

After running train.py file I'm getting 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

How to fix it

layumi commented 4 years ago

@ssbilakeri Sorry for the late response. Did you run your code on Windows? Pytorch supports for multi-processing on Windows is not good. So you may try to set nworkers=0 in dataloader.

atul2oct commented 3 years ago

Hello You have done excellent and impressive work. Actually, I am new in machine learning and I was trying to run the code but I was facing problems. It would be grateful if you help me

This is not an error. If you want to use low precision, i.e., fp16, please install the apex with cuda support (https://github.com/NVIDIA/apex) and update pytorch to 1.0 [Resize(size=(256, 128), interpolation=PIL.Image.BICUBIC), Pad(padding=10, fill=0, padding_mode=constant), RandomCrop(size=(256, 128), padding=None), RandomHorizontalFlip(p=0.5), ToTensor(), Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])]

Traceback (most recent call last): File "", line 1, in File "C:\Users\ATUL\Anaconda3\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "C:\Users\ATUL\Anaconda3\lib\multiprocessing\spawn.py", line 125, in _main prepare(preparation_data) File "C:\Users\ATUL\Anaconda3\lib\multiprocessing\spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "C:\Users\ATUL\Anaconda3\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "C:\Users\ATUL\Anaconda3\lib\runpy.py", line 265, in run_path return _run_module_code(code, init_globals, run_name, File "C:\Users\ATUL\Anaconda3\lib\runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "C:\Users\ATUL\Anaconda3\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\ATUL\Desktop\Python\Person_reID_baseline_pytorch-master\train.py", line 19, in from model import ft_net, ft_net_dense, ft_net_NAS, PCB ModuleNotFoundError: No module named 'model'

what would have to put in 'model' folder?

layumi commented 1 year ago

Hi @atul2oct

Sorry...I just see your reply.

No. Actally, from model import ft_net, ft_net_dense, ft_net_NAS, PCB is to load the function from model.py. There is no relation with the folder model.