DeepAlignmentNetwork
DeepAlignmentNetwork copied to clipboard
Error when generate validation dataset
Hi friends,
I got an error:
Traceback (most recent call last):
File "TrainingSetPreparation.py", line 21, in
Hi, It seems like the bounding box data for the filename you specified is not there. Check if you are specifying the correct bounding box file for the given dataset, this happens in the two lines shown below:
imageDirs = ["../data/images/lfpw/trainset/", "../data/images/helen/trainset/", "../data/images/afw/"]
boundingBoxFiles = ["../data/boxesLFPWTrain.pkl", "../data/boxesHelenTrain.pkl", "../data/boxesAFW.pkl"]
Thanks,
Marek
hello,friend. thanks for share ur code. i meet same KeyError,just as Onoto has meet. and i have checked the imageDirs and boundingBoxFiles,everything is unmodified,and unzip the dataset to designated folder.
And i want to rewrite ur code in pytorch,could u give me some support.thanks
Hi,
Have you done some standard debugging on this? For example:
- check which .npz file that happens in,
- check whether that file exists,
- check whether this is the correct bounding box file for that directory.
If you have any specific question about the method that would help your pytorch implementation I will be more than happy to answer.
Thanks,
Marek
to solve this problem , you need to modify those code:
if boundingBoxFiles is not None:
basename = path.basename(filenamesInDir[j])
boundingBoxes.append(boundingBoxDict[basename])
to:
if boundingBoxFiles is not None:
basename = path.basename(filenamesInDir[j])
basename=bytes(basename,encoding='utf-8')
boundingBoxes.append(boundingBoxDict[basename])
cause the key of boundingBoxDict is encoding in bytes,but the type of basename is string ,so you need transform the type of basename from string to bytes .it will work.
Good find! Do you want to submit a PR for this?
Thanks,
Marek