komiya-m / MirrorGAN

28 stars 12 forks source link

AssertionError #4

Open WafflesJohnny opened 5 years ago

WafflesJohnny commented 5 years ago

Hello, when I run the code in Pycharm, I get the following error:

Traceback (most recent call last):
  File "pretrain_STREAM.py", line 89, in <module>
    main()
  File "pretrain_STREAM.py", line 47, in main
    assert dataset
AssertionError

I believe it is due to the function load_filenames (posted below). It is from dataset.py. Starting on line 235. Whenever the program reaches this statement in the function:

if os.path.isfile(filepath):

It always evaluates to false. When this happens I get the above error. In both cases when the function is called, it seems to be looking for a "filenames.pickle" file that doesn't exist. The files are supposed to be in:

data/birds/train data/birds/test

My question is, are these files supposed to exist before running the code, or does the code create them during runtime?

I noticed that the code created "captions.pickle". So I wasn't sure if they should be doing the same with the other two. Thank you.

   def load_filenames(self, data_dir, split):
        filepath = '%s/%s/filenames.pickle' % (data_dir, split)
        if os.path.isfile(filepath):
            with open(filepath, 'rb') as f:
                filenames = pickle.load(f)
            print('Load filenames from: %s (%d)' % (filepath, len(filenames)))
        else:
            filenames = []
        return filenames