Please make sure that you are currently using the correct working environment (refer to this document for setting the environment).
and the correct python interpreter is selected, you can change it by clicking on the current interpreter displayed in the status bar in the lower right corner,

Or use ctrl+shift+p to enter Python:Select Interpreter.

Another way: add the path to the module in your setting.json
. E.g:
"python.analysis.extraPaths":[
// The folder path where the custom module is located, and multiple paths can be added (the following is just an example)
"E:\\myfolder\\homework\\one\\Person_reID_baseline_pytorch-master" ,
"E:\\...\\...\\...\\..."
]
Hope this helps you