carpedm20 / ENAS-pytorch

PyTorch implementation of "Efficient Neural Architecture Search via Parameters Sharing"
Apache License 2.0
2.69k stars 492 forks source link

AttributeError:‘DataLoader’ object has no attribute ‘size’ #37

Open Jihao-Li opened 5 years ago

Jihao-Li commented 5 years ago

Hello, guys. When I run this command: python main.py --network_type cnn --dataset cifar --controller_optim momentum --controller_lr_cosine=True --controller_lr_max 0.05 --controller_lr_min 0.0001 --entropy_coeff 0.1 I got a AttributeError:‘DataLoader’ object has no attribute ‘size’. This is in 148 line in the utils.py. And 'Dataloader' object has no attribute 'narrow' and 'view'. The version of pytorch in my computer is 0.4.1. Is my version wrong? Has anyone got any ideas for this problem?

svjack commented 5 years ago

Current Implementation seemed only support nlp example task (search construction of rnn cell) the Trainer class now only accept dataset param as torch.Tensor class rather than DataLoader and the doc string had elaborate it. The structure search implementation class in shared_cnn.py not implement favor functions consider update date of this project, should consider abandon this project.

Jihao-Li commented 5 years ago

OK! Thank you!

svjack commented 5 years ago

OK! Thank you! I recommend you to try https://github.com/renqianluo/NAO it seems a mixture of current project and the official implemetation https://github.com/melodyguan/enas except that it replaced RL learning optimize method by nlp seq2seq methods if you prefer, You can try to fixed it into RL form.

Jihao-Li commented 5 years ago
      > OK! Thank you!

I recommend you to try https://github.com/renqianluo/NAO it seems a mixture of current project and the official implemetation https://github.com/melodyguan/enas except that it replaced RL learning optimize method by nlp seq2seq methods if you prefer, You can try to fixed it into RL form.

Thank you for your help. I will have a try.