All Projects → chenxi116 → Pnasnet.pytorch

chenxi116 / Pnasnet.pytorch

Licence: apache-2.0
PyTorch implementation of PNASNet-5 on ImageNet

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pnasnet.pytorch

Petridishnn
Code for the neural architecture search methods contained in the paper Efficient Forward Neural Architecture Search
Stars: ✭ 112 (-63.75%)
Mutual labels:  automl, imagenet, neural-architecture-search
Pnasnet.tf
TensorFlow implementation of PNASNet-5 on ImageNet
Stars: ✭ 102 (-66.99%)
Mutual labels:  automl, imagenet, neural-architecture-search
Sgas
SGAS: Sequential Greedy Architecture Search (CVPR'2020) https://www.deepgcns.org/auto/sgas
Stars: ✭ 137 (-55.66%)
Mutual labels:  automl, neural-architecture-search
Naszilla
Naszilla is a Python library for neural architecture search (NAS)
Stars: ✭ 181 (-41.42%)
Mutual labels:  automl, neural-architecture-search
Hypernets
A General Automated Machine Learning framework to simplify the development of End-to-end AutoML toolkits in specific domains.
Stars: ✭ 221 (-28.48%)
Mutual labels:  automl, neural-architecture-search
regnet.pytorch
PyTorch-style and human-readable RegNet with a spectrum of pre-trained models
Stars: ✭ 50 (-83.82%)
Mutual labels:  imagenet, neural-architecture-search
Nas Benchmark
"NAS evaluation is frustratingly hard", ICLR2020
Stars: ✭ 126 (-59.22%)
Mutual labels:  automl, neural-architecture-search
AutoSpeech
[InterSpeech 2020] "AutoSpeech: Neural Architecture Search for Speaker Recognition" by Shaojin Ding*, Tianlong Chen*, Xinyu Gong, Weiwei Zha, Zhangyang Wang
Stars: ✭ 195 (-36.89%)
Mutual labels:  automl, neural-architecture-search
Neural-Architecture-Search
This repo is about NAS
Stars: ✭ 26 (-91.59%)
Mutual labels:  automl, neural-architecture-search
BossNAS
(ICCV 2021) BossNAS: Exploring Hybrid CNN-transformers with Block-wisely Self-supervised Neural Architecture Search
Stars: ✭ 125 (-59.55%)
Mutual labels:  automl, neural-architecture-search
Autogluon
AutoGluon: AutoML for Text, Image, and Tabular Data
Stars: ✭ 3,920 (+1168.61%)
Mutual labels:  automl, neural-architecture-search
Awesome Automl Papers
A curated list of automated machine learning papers, articles, tutorials, slides and projects
Stars: ✭ 3,198 (+934.95%)
Mutual labels:  automl, neural-architecture-search
Amla
AutoML frAmework for Neural Networks
Stars: ✭ 119 (-61.49%)
Mutual labels:  automl, neural-architecture-search
Awesome Autodl
A curated list of automated deep learning (including neural architecture search and hyper-parameter optimization) resources.
Stars: ✭ 1,819 (+488.67%)
Mutual labels:  automl, neural-architecture-search
Deephyper
DeepHyper: Scalable Asynchronous Neural Architecture and Hyperparameter Search for Deep Neural Networks
Stars: ✭ 117 (-62.14%)
Mutual labels:  automl, neural-architecture-search
Awesome Nas Papers
Awesome Neural Architecture Search Papers
Stars: ✭ 213 (-31.07%)
Mutual labels:  automl, neural-architecture-search
Nni
An open source AutoML toolkit for automate machine learning lifecycle, including feature engineering, neural architecture search, model compression and hyper-parameter tuning.
Stars: ✭ 10,698 (+3362.14%)
Mutual labels:  automl, neural-architecture-search
nas-encodings
Encodings for neural architecture search
Stars: ✭ 29 (-90.61%)
Mutual labels:  automl, neural-architecture-search
HyperKeras
An AutoDL tool for Neural Architecture Search and Hyperparameter Optimization on Tensorflow and Keras
Stars: ✭ 29 (-90.61%)
Mutual labels:  automl, neural-architecture-search
TF-NAS
TF-NAS: Rethinking Three Search Freedoms of Latency-Constrained Differentiable Neural Architecture Search (ECCV2020)
Stars: ✭ 66 (-78.64%)
Mutual labels:  imagenet, neural-architecture-search

PNASNet.pytorch

PyTorch implementation of PNASNet-5. Specifically, PyTorch code from this repository is adapted to completely match both my implemetation and the official implementation of PNASNet-5, both written in TensorFlow. This complete match allows the pretrained TF model to be exactly converted to PyTorch: see convert.py.

If you use the code, please cite:

@inproceedings{liu2018progressive,
  author    = {Chenxi Liu and
               Barret Zoph and
               Maxim Neumann and
               Jonathon Shlens and
               Wei Hua and
               Li{-}Jia Li and
               Li Fei{-}Fei and
               Alan L. Yuille and
               Jonathan Huang and
               Kevin Murphy},
  title     = {Progressive Neural Architecture Search},
  booktitle = {European Conference on Computer Vision},
  year      = {2018}
}

Requirements

  • TensorFlow 1.8.0 (for image preprocessing)
  • PyTorch 0.4.0
  • torchvision 0.2.1

Data and Model Preparation

  • Download the ImageNet validation set and move images to labeled subfolders. To do the latter, you can use this script. Make sure the folder val is under data/.
  • Download PNASNet.TF and follow its README to download the PNASNet-5_Large_331 pretrained model.
  • Convert TensorFlow model to PyTorch model:
python convert.py

Notes on Model Conversion

  • In both TensorFlow implementations, net[0] means prev and net[1] means prev_prev. However, in the PyTorch implementation, states[0] means prev_prev and states[1] means prev. I followed the PyTorch implemetation in this repository. This is why the 0 and 1 in PNASCell specification are reversed.
  • The default value of eps in BatchNorm layers is 1e-3 in TensorFlow and 1e-5 in PyTorch. I changed all BatchNorm eps values to 1e-3 (see operations.py) to exactly match the TensorFlow pretrained model.
  • The TensorFlow pretrained model uses tf.image.resize_bilinear to resize the image (see utils.py). I cannot find a python function that exactly matches this function's behavior (also see this thread and this post on this topic), so currently in main.py I call TensorFlow to do the image preprocessing, in order to guarantee both models have the identical input.
  • When converting the model from TensorFlow to PyTorch (i.e. convert.py), I use input image size of 323 instead of 331. This is because the 'SAME' padding in TensorFlow may differ from padding in PyTorch in some layers (see this link; basically TF may only pad 1 right and bottom, whereas PyTorch always pads 1 for all four margins). However, they behave exactly the same when image size is 323: conv0 does not have padding, so feature size becomes 161, then 81, 41, etc.
  • The exact conversion when image size is 323 is also corroborated by the following table:
Image Size Official TensorFlow Model Converted PyTorch Model
(331, 331) (0.829, 0.962) (0.828, 0.961)
(323, 323) (0.827, 0.961) (0.827, 0.961)

Usage

python main.py

The last printed line should read:

Test: [50000/50000]	[email protected] 0.828	[email protected] 0.961
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].