Comments (3)
FWIW, I've managed to run example.py
under TensorFlow 2.3.1 with the following tf -> tf.compat.v1
modifications:
diff --git a/nasbench/api.py b/nasbench/api.py index 236897f..97173f2 100644 --- a/nasbench/api.py +++ b/nasbench/api.py @@ -143,7 +143,7 @@ class NASBench(object): # {108} for the smaller dataset with only the 108 epochs. self.valid_epochs = set() - for serialized_row in tf.python_io.tf_record_iterator(dataset_file): + for serialized_row in tf.compat.v1.python_io.tf_record_iterator(dataset_file): # Parse the data from the data file. module_hash, epochs, raw_adjacency, raw_operations, raw_metrics = ( json.loads(serialized_row.decode('utf-8'))) diff --git a/nasbench/lib/evaluate.py b/nasbench/lib/evaluate.py index b8cbf2c..3c38e82 100644 --- a/nasbench/lib/evaluate.py +++ b/nasbench/lib/evaluate.py @@ -27,7 +27,7 @@ import numpy as np import tensorflow as tf VALID_EXCEPTIONS = ( - tf.train.NanLossDuringTrainingError, # NaN loss + tf.compat.v1.train.NanLossDuringTrainingError, # NaN loss tf.errors.ResourceExhaustedError, # OOM tf.errors.InvalidArgumentError, # NaN gradient tf.errors.DeadlineExceededError, # Timed out diff --git a/nasbench/lib/training_time.py b/nasbench/lib/training_time.py index 691d4ec..56dd1da 100644 --- a/nasbench/lib/training_time.py +++ b/nasbench/lib/training_time.py @@ -127,7 +127,7 @@ _TimingVars = collections.namedtuple( # pylint: disable=g-bad-name ]) -class _TimingRunHook(tf.train.SessionRunHook): +class _TimingRunHook(tf.compat.v1.train.SessionRunHook): """Hook to stop the training after a certain amount of time.""" def __init__(self, max_train_secs=None): @@ -171,7 +171,7 @@ class _TimingRunHook(tf.train.SessionRunHook): run_context.request_stop() -class _TimingSaverListener(tf.train.CheckpointSaverListener): +class _TimingSaverListener(tf.compat.v1.train.CheckpointSaverListener): """Saving listener to store the train time up to the last checkpoint save.""" def begin(self):
$ git clone https://github.com/google-research/nasbench
$ cd nasbench
$ virtualenv venv
created virtual environment CPython3.8.5.final.0-64 in 179ms
creator CPython3Posix(dest=/home/anton/projects/nasbench/venv, clear=False, global=False)
seeder FromAppData(download=False, ipaddr=latest, progress=latest, urllib3=latest, wheel=latest, distro=latest, pkg_resources=latest, retrying=latest, setuptools=latest, chardet=latest, lockfile=latest, pytoml=latest, colorama=latest, pep517=latest, contextlib2=latest, six=latest, packaging=latest, certifi=latest, webencodings=latest, requests=latest, appdirs=latest, pip=latest, pyparsing=latest, msgpack=latest, idna=latest, html5lib=latest, distlib=latest, CacheControl=latest, via=copy, app_data_dir=/home/anton/.local/share/virtualenv/seed-app-data/v1.0.1.debian)
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
$ source venv/bin/activate
(venv) $ pip install -e .
Running setup.py develop for nasbench
Successfully installed nasbench tensorboard-2.4.0 tensorflow-2.3.1 tensorflow-estimator-2.3.0
from nasbench.
I think I've implemented a version in tf2.0: https://github.com/ultmaster/nasbench/tree/tf2.
It's not a full version (channel compute is not included) but should be a good start. I've trained a few architectures and sometimes achieved even better results than reported.
from nasbench.
That's very helpful, thanks a lot! I noticed that the results reported in paper are evaluated across only 500 individual trials for each search alogrithm.
from nasbench.
Related Issues (20)
- y-axis in Fig 7(left) HOT 4
- Reproduce Figure 8 in the NASBench paper
- Are there any api of turning the 01 spec_matrix into model_architecture? HOT 1
- Generating a dataset (tfrecord files) HOT 1
- how to create model instance using matrix?
- RMSProp epsilon=1.0, why?
- How to get the FLOPs of a model HOT 2
- Lower than expected final test accuracies for some models? HOT 1
- Data Query is non-deterministic HOT 1
- hdf5 file format
- tensorflow 2.3.1 incompatibility HOT 1
- How to extract all the architectures and metrics from the records? HOT 1
- source code for calculating the graph edit distance HOT 1
- what is "total_time" in the tfrecord file?
- is_valid is true, query function report errors HOT 1
- Handling isomorphic architectures in benchmarked algorithms ? HOT 1
- How much mean test accuracy can the best architecure achieve? HOT 1
- Have you compare the execution time of various algorithms? HOT 4
- Query neighbors of an architecture HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nasbench.