Seanlinx / mtcnn

593 stars 264 forks source link

No such file or directory:'../data/cache/mtcnn_pnet/train_12_gt_roidb.pkl' #9

Open HZQ-GitHub opened 7 years ago

HZQ-GitHub commented 7 years ago

Hello,I met a problem when I run "python train_P_net.py" with Windows, It print errors like that:

C:\Users\user\Desktop\V2_MXNet\example>python train_P_net.py Called with argument: Namespace(begin_epoch=0, dataset_path='../data/mtcnn', end_epoch=16, epoch=0, frequent=200, gpu_ids='0', image_set='pnet/train_12', lr=0.01, prefix='model/pnet', pretrained='model/pnet', resume=False, root_path='../data') Traceback (most recent call last): File "train_P_net.py", line 56, in args.pretrained, args.epoch,args.begin_epoch, args.end_epoch, args.frequent, args.lr, args.resume) File "train_P_net.py", line 14, in train_P_net gt_imdb = imdb.gt_imdb() File "..\core\imdb.py", line 72, in gt_imdb with open(cache_file, 'wb') as f: IOError: [Errno 2] No such file or directory: '../data\cache\mtcnn_pnet/train_12_gt_roidb.pkl'

It seems no train_12_gt_roidb.pkl,could you tell me how to generate the .pkl file? Thx

Seanlinx commented 7 years ago

You don't have a folder named "mtcnn_pnet" under ./data/cache so it fails to generate the .pkl file. It's a simple problem if you read the code where the error occurs.

poppy007 commented 5 years ago

how to solve the following problem:

   Traceback (most recent call last):
    File "/home/xxx/workspace/face/seanlinux/mtcnn-master/example/train_P_net.py", line 73, in <module>
args.begin_epoch, args.end_epoch, args.frequent, args.lr, args.resume)

File "/home/xxx/workspace/face/seanlinux/mtcnn-master/example/train_P_net.py", line 11, in train_P_net gt_imdb = imdb.gt_imdb() File "/home/xxx/workspace/face/seanlinux/mtcnn-master/core/imdb.py", line 71, in gt_imdb imdb = pickle.load(f) EOFError: Ran out of input

    Details coding position as following:
    cache_file = os.path.join(self.cache_path, self.name + '_gt_roidb.pkl')
    size_cache_file = os.path.getsize(cache_file)
    #if size_cache_file == 0:
    #    return None

    if os.path.exists(cache_file):
        with open(cache_file, 'rb') as f:
            imdb = pickle.load(f)
        print('{} gt imdb loaded from {}'.format(self.name, cache_file))
        return imdb
         I think Have to generate the *.pkl file by coding that can solve above problem.
poppy007 commented 5 years ago

Hello,I met a problem when I run "python train_P_net.py" with Windows, It print errors like that:

C:\Users\user\Desktop\V2_MXNet\example>python train_P_net.py Called with argument: Namespace(begin_epoch=0, dataset_path='../data/mtcnn', end_epoch=16, epoch=0, frequent=200, gpu_ids='0', image_set='pnet/train_12', lr=0.01, prefix='model/pnet', pretrained='model/pnet', resume=False, root_path='../data') Traceback (most recent call last): File "train_P_net.py", line 56, in args.pretrained, args.epoch,args.begin_epoch, args.end_epoch, args.frequent, args.lr, args.resume) File "train_P_net.py", line 14, in train_P_net gt_imdb = imdb.gt_imdb() File "..\core\imdb.py", line 72, in gt_imdb with open(cache_file, 'wb') as f: IOError: [Errno 2] No such file or directory: '../data\cache\mtcnn_pnet/train_12_gt_roidb.pkl'

It seems no train_12_gt_roidb.pkl,could you tell me how to generate the .pkl file? Thx

Can you tell me how to solve above problem? Thx

poppy007 commented 5 years ago

I rectify the code by the following method, and the code are work... Details coding position as following: cache_file = os.path.join(self.cache_path, self.name + '_gt_roidb.pkl') size_cache_file = 0 if os.path.exists(cache_file): size_cache_file = os.path.getsize(cache_file)

if os.path.exists(cache_file):
    with open(cache_file, 'rb') as f:
        imdb = pickle.load(f)
    print('{} gt imdb loaded from {}'.format(self.name, cache_file))
    return imdb