sg-nm / cgp-cnn-PyTorch

A Genetic Programming Approach to Designing CNN Architectures, In GECCO 2017 (oral presentation, Best Paper Award)
MIT License
46 stars 24 forks source link

Is it possible that you've made a mistake about the version of Pytorch. #1

Open marsggbo opened 6 years ago

marsggbo commented 6 years ago
 >>> pip install torch==0.2.0_4 torchvision
Collecting torch==0.2.0_4
  Could not find a version that satisfies the requirement torch==0.2.0_4 (from versions: 0.1.2, 0.1.2.post1, 0.3.1, 0.4.0, 0.4.1)
No matching distribution found for torch==0.2.0_4
sg-nm commented 6 years ago

Thank you for your post. Currently, the version 0.2 seems to be invalid... Can you please install another version of PyTorch (e.g, 0.4.1)?

marsggbo commented 6 years ago

image.png image.png

The above is the result obtained by 'python exp_main.py -g 2', but it seems not work. Moreover, though there are error reports, the code can still be run.

The environment are as following:

sg-nm commented 6 years ago

Please change the code of line 199 and 267 in cnn_train.py file as follows:

correct += predicted.eq(label_.data).cpu().sum().item()

marsggbo commented 6 years ago

Thank you so much, the code succeded to run but with some future version warning. Besides, I still have some questions:

  1. The code has run for many many times, what the expected result should be?
  2. Which part in the code I need to change if I want to transfer to my own dataset?
sg-nm commented 6 years ago
  1. To get the results reported in our paper, you first need to perform the evolution process for 500 generations. Then you need to retrain the best architecture for 500 epochs using the retraining settings described in our paper.

  2. In our code, we define our dataloader in the line 121 of cnn_train.py. For using your own dataset, you need to delete the line 121 in cnn_train.py and define your dataloader here.