microsoft / Semantics-Aligned-Representation-Learning-for-Person-Re-identification

This is an implementation of AAAI'20 paper "Semantics-Aligned Representation Learning for Person Re-identification". We leverages dense semantics to address both the spatial misalignment and semantics misalignment challenges in person re-identification.
MIT License
23 stars 13 forks source link

ModuleNotFoundError: No module named 'network_models' #2

Open xuwanlu opened 4 years ago

xuwanlu commented 4 years ago

I meet error :ModuleNotFoundError: No module named 'network_models, so I can't load the 'pkl model, can you update the file ? or can you give me some advice?

wencoast commented 4 years ago

@xuwanlu Have you solved this problem, I meet the same problem.

jinx-USTC commented 4 years ago

which step you meet this problem????

wencoast commented 4 years ago

@jinx-USTC

More details can be found as follows,

/project/snow_datasets/Re_ID_datasets/model_weights/texture_generation_weights/texture_generation_weights.pkl Traceback (most recent call last): File "/home/p283369/PaperWork/CASIA_Work/semantic_alignment_re_id_own_project/SemanticAlignmentReID/generate_texture_backup.py", line 55, in generator = Generate_texture(model_path) File "/home/p283369/PaperWork/CASIA_Work/semantic_alignment_re_id_own_project/SemanticAlignmentReID/generate_texture_backup.py", line 17, in init self.model = torch.load(model_path, map_location='cpu') #0.4.1版本的pytorch也不行 File "/home/p283369/miniconda3/envs/pytorch/lib/python3.7/site-packages/torch/serialization.py", line 367, in load return _load(f, map_location, pickle_module) File "/home/p283369/miniconda3/envs/pytorch/lib/python3.7/site-packages/torch/serialization.py", line 538, in _load result = unpickler.load() ModuleNotFoundError: No module named 'network_models'

jinx-USTC commented 4 years ago

Sorry, I didn't meet this problem, and maybe you can refer to this link to find solution: https://github.com/microsoft/MMdnn/issues/572

jszgz commented 4 years ago

python generate_texture.py -m /DOWNLOADED_SAN-PG_WEIGHTS -i example_results/input -o example_results/texture

When running this, I met this problem, too. @xuwanlu Have you solved this problem?

jszgz commented 4 years ago

If I create a directory named "network_models" , then the error became ModuleNotFoundError: No module named 'network_models.unet' If I create a python file in network_models named 'unet' , then the error became Can't get attribute 'UNet' on <module 'network_models.unet' If I create UNet class in file network_models/unet.py, then the error became type object 'UNet' has no attribute 'dump_patches' If I inherit torch.nn.Module , then the error became Can't get attribute 'UNet_' on <module 'network_models.unet'

Anyway, I can't use the pkl file you provide to Generate Pseudo Groundtruth Texture Images, and can you explain why did you use UNet while you said you 'reuse the proposed SAN-PG'.

jszgz commented 4 years ago

TextureGeneration

network_models are in another repo, copy those to this repo so you can run generate_texture.py

So, the author use Another Repo to Generate Pseudo Groundtruth Texture Images or did use SAN-PG as in the paper? @jinx-USTC

jszgz commented 4 years ago

HASH The pre-trained weight for SAN-PG and pretrained weight in yt4766269/TextureGeneration have same SHA1-HASH CODE?

wencoast commented 4 years ago

@jszgz @jinx-USTC Could you send one email to my email address? May I ask you something about this project? My email address is codingprogram@outlook.com.