D-X-Y / AutoDL-Projects

Automated deep learning algorithms implemented in PyTorch.
MIT License
1.57k stars 282 forks source link

How to search and train GDAS (FRC) on personal data? #72

Closed Yulv-git closed 4 years ago

Yulv-git commented 4 years ago

Excuse me, I couldn't find GDAS (FRC) search and training program. How should I search and train GDAS (FRC) on personal data sets?

D-X-Y commented 4 years ago

Good question. GDAS (FRC) uses a fixed reduction cell (https://github.com/D-X-Y/AutoDL-Projects/blob/master/lib/models/cell_operations.py#L244). When reduction=True, you can replace the SearchCell (https://github.com/D-X-Y/AutoDL-Projects/blob/master/lib/models/cell_searchs/search_model_gdas_nasnet.py#L32) by this fixed cell.

Yulv-git commented 4 years ago

Good question. GDAS (FRC) uses a fixed reduction cell (https://github.com/D-X-Y/AutoDL-Projects/blob/master/lib/models/cell_operations.py#L244). When reduction=True, you can replace the SearchCell (https://github.com/D-X-Y/AutoDL-Projects/blob/master/lib/models/cell_searchs/search_model_gdas_nasnet.py#L32) by this fixed cell.

Thank you for your answer. However, there will be some bugs when I replace the SearchCell with GDAS_Reduction_Cell. Can you tell me the details of how to implement GDAS (FRC)? Thank you very much!

D-X-Y commented 4 years ago

Would you mind to provide details with the bugs?

Yulv-git commented 4 years ago

Would you mind to provide details with the bugs? I add if reduction == True:... as flow in search_model_gdas_nasnet.py

for index, (C_curr, reduction) in enumerate(zip(layer_channels, layer_reductions)): cell = SearchCell( search_space, steps, multiplier, C_prev_prev, C_prev, C_curr, reduction, reduction_prev, affine, track_running_stats) if reduction == True: cell = GDAS_Reduction_Cell( C_prev_prev, C_prev, C_curr, reduction_prev, multiplier, affine, track_running_stats)

The bug is Traceback (most recent call last): File "./exps/algos/GDAS.py", line 371, in <module> main(args) File "./exps/algos/GDAS.py", line 176, in main search_model = get_cell_based_tiny_net(model_config) File "/data/home/yulv/PycharmProjects/NAS_GDAS_SETN_TAS/lib/models/__init__.py", line 38, in get_cell_based_tiny_net config.space, config.affine, config.track_running_stats) # return: out, logits File "/data/home/yulv/PycharmProjects/NAS_GDAS_SETN_TAS/lib/models/cell_searchs/search_model_gdas_nasnet.py", line 63, in __init__ assert num_edge == cell.num_edges and edge2index == cell.edge2index, 'invalid {:} vs. {:}.'.format( File "/data/home/yulv/anaconda3/envs/do/lib/python3.6/site-packages/torch/nn/modules/module.py", line 585, in __getattr__ type(self).__name__, name)) AttributeError: 'GDAS_Reduction_Cell' object has no attribute 'num_edges'

Did I use GDAS (FRC) wrong?

D-X-Y commented 4 years ago

Sorry for the late reply. I will try to fix in this weekend.

D-X-Y commented 4 years ago

@Yulv-git Sorry for the late reply. The recent commit (https://github.com/D-X-Y/AutoDL-Projects/commit/ffd23a6cbdc4b1ed911bc3349681cee3e1333569) have supported the GDAS (FRC).

Updated README: https://github.com/D-X-Y/AutoDL-Projects/blob/master/docs/CVPR-2019-GDAS.md#searching-on-the-nasnet-search-space

CUDA_VISIBLE_DEVICES=0 bash ./scripts-search/NASNet-space-search-by-GDAS-FRC.sh cifar10 1 -1