Model search is a framework that implements AutoML algorithms for model architecture search at scale

Overview

Model Search

header

Model search (MS) is a framework that implements AutoML algorithms for model architecture search at scale. It aims to help researchers speed up their exploration process for finding the right model architecture for their classification problems (i.e., DNNs with different types of layers).

The library enables you to:

  • Run many AutoML algorithms out of the box on your data - including automatically searching for the right model architecture, the right ensemble of models and the best distilled models.

  • Compare many different models that are found during the search.

  • Create you own search space to customize the types of layers in your neural networks.

The technical description of the capabilities of this framework are found in InterSpeech paper.

While this framework can potentially be used for regression problems, the current version supports classification problems only. Let's start by looking at some classic classification problems and see how the framework can automatically find competitive model architectures.

Getting Started

Let us start with the simplest case. You have a csv file where the features are numbers and you would like to run let AutoML find the best model architecture for you.

Below is a code snippet for doing so:

import model_search
from model_search import constants
from model_search import single_trainer
from model_search.data import csv_data

trainer = single_trainer.SingleTrainer(
    data=csv_data.Provider(
        label_index=0,
        logits_dimension=2,
        record_defaults=[0, 0, 0, 0],
        filename="model_search/data/testdata/csv_random_data.csv"),
    spec=constants.DEFAULT_DNN)

trainer.try_models(
    number_models=200,
    train_steps=1000,
    eval_steps=100,
    root_dir="/tmp/run_example",
    batch_size=32,
    experiment_name="example",
    experiment_owner="model_search_user")

The above code will try 200 different models - all binary classification models, as the logits_dimension is 2. The root directory will have a subdirectory of all models, all of which will be already evaluated. You can open the directory with tensorboard and see all the models with the evaluation metrics.

The search will be performed according to the default specification. That can be found in: model_search/configs/dnn_config.pbtxt.

For more details about the fields and if you want to create your own specification, you can look at: model_search/proto/phoenix_spec.proto.

Now, what if you don't have a csv with the features? The next section shows how to run without a csv.

Non-csv data

To run with non-csv data, you will have to implement a class inherited from the abstract class model_search.data.Provider. This enables us to define our own input_fn and hence customize the feature columns and the task (i.e., the number of classes in the classification task).

class Provider(object, metaclass=abc.ABCMeta):
  """A data provider interface.

  The Provider abstract class that defines three function for Estimator related
  training that return the following:
    * An input function for training and test input functions that return
      features and label batch tensors. It is responsible for parsing the
      dataset and buffering data.
    * The feature_columns for this dataset.
    * problem statement.
  """

  def get_input_fn(self, hparams, mode, batch_size: int):
    """Returns an `input_fn` for train and evaluation.

    Args:
      hparams: tf.HParams for the experiment.
      mode: Defines whether this is training or evaluation. See
        `estimator.ModeKeys`.
      batch_size: the batch size for training and eval.

    Returns:
      Returns an `input_fn` for train or evaluation.
    """

  def get_serving_input_fn(self, hparams):
    """Returns an `input_fn` for serving in an exported SavedModel.

    Args:
      hparams: tf.HParams for the experiment.

    Returns:
      Returns an `input_fn` that takes no arguments and returns a
        `ServingInputReceiver`.
    """

  @abc.abstractmethod
  def number_of_classes(self) -> int:
    """Returns the number of classes. Logits dim for regression."""

  def get_feature_columns(
      self
  ) -> List[Union[feature_column._FeatureColumn,
                  feature_column_v2.FeatureColumn]]:
    """Returns a `List` of feature columns."""

An example of an implementation can be found in model_search/data/csv_data.py.

Once you have this class, you can pass it to model_search.single_trainer.SingleTrainer and your single trainer can now read your data.

Adding your models and architectures to a search space

You can use our platform to test your own existing models.

Our system searches over what we call blocks. We have created an abstract API for an object that resembles a layer in a DNN. All that needs to be implemented for this class is two functions:

class Block(object, metaclass=abc.ABCMeta):
  """Block api for creating a new block."""

  @abc.abstractmethod
  def build(self, input_tensors, is_training, lengths=None):
    """Builds a block for phoenix.

    Args:
      input_tensors: A list of input tensors.
      is_training: Whether we are training. Used for regularization.
      lengths: The lengths of the input sequences in the batch.

    Returns:
      output_tensors: A list of the output tensors.
    """

  @abc.abstractproperty
  def is_input_order_important(self):
    """Is the order of the entries in the input tensor important.

    Returns:
      A bool specifying if the order of the entries in the input is important.
      Examples where the order is important: Input for a cnn layer.
      (e.g., pixels an image). Examples when the order is not important:
      Input for a dense layer.
    """

Once you have implemented your own blocks (i.e., layers), you need to register them with a decorator. Example:

@register_block(
    lookup_name='AVERAGE_POOL_2X2', init_args={'kernel_size': 2}, enum_id=8)
@register_block(
    lookup_name='AVERAGE_POOL_4X4', init_args={'kernel_size': 4}, enum_id=9)
class AveragePoolBlock(Block):
  """Average Pooling layer."""

  def __init__(self, kernel_size=2):
    self._kernel_size = kernel_size

  def build(self, input_tensors, is_training, lengths=None):

(All code above can be found in model_search/blocks.py). Once registered, you can tell the system to search over these blocks by supplying them in blocks_to_use in PhoenixSpec in model_search/proto/phoenix_spec.proto. Namely, if you look at the default specification for dnn found in model_search/configs/dnn_config.pbtxt, you can change the repeated field blocks_to_use and add you own registered blocks.

Note: Our system stacks blocks one on top of each other to create tower architectures that are then going to be ensembled. You can set the minimal and maximal depth allowed in the config to 1 which will change the system to search over which block perform best for the problem - I.e., your blocks can be now an implementation of full classifiers and the system will choose the best one.

Creating a training stand alone binary without writing a main

Now, let's assume you have the data class, but you don't want to write a main function to run it.

We created a simple way to create a main that will just train a dataset and is configurable via flags.

To create it, you need to follow two steps:

  1. You need to register your data provider.

  2. You need to call a help function to create a build rule.

Example: Suppose you have a provider, then you need to register it via a decorator we define it as follows:

@data.register_provider(lookup_name='csv_data_provider', init_args={})
class Provider(data.Provider):
  """A csv data provider."""

  def __init__(self):

The above code can be found in model_search/data/csv_data_for_binary.py.

Next, once you have such library (data provider defined in a .py file and registered), you can supply this library to a help build function an it will create a binary rule as follows:

model_search_oss_binary(
    name = "csv_data_binary",
    dataset_dep = ":csv_data_for_binary",
)

You can also add a test automatically to test integration of your provider with the system as follows:

model_search_oss_test(
    name = "csv_data_for_binary_test",
    dataset_dep = ":csv_data_for_binary",
    problem_type = "dnn",
    extra_args = [
        "--filename=$${TEST_SRCDIR}/model_search/data/testdata/csv_random_data.csv",
    ],
    test_data = [
        "//model_search/data/testdata:csv_random_data",
    ],
)

The above function will create a runable binary. The snippets are taken from the following file: model_search/data/BUILD. The binary is configurable by the flags in model_search/oss_trainer_lib.py.

Distributed Runs

Our system can run a distributed search - I.e., run many search trainer in parallel.

How does it work?

You need to run your binary on multiple machines. Additionally, you need to make one change to configure the bookkeeping of the search.

On a single machine, the bookkeeping is done via a file. For a distributed system however, we need a database.

In order to point our system to the database, you need to set the flags in the file:

model_search/metadata/ml_metadata_db.py

to point to your database.

Once you have done so, the binaries created from the previous section will connect to this database and an async search will begin.

Cloud AutoML

Want to try higher performance AutoML without writing code? Try: https://cloud.google.com/automl-tables

Comments
  • Cannot connect sqlite3 database

    Cannot connect sqlite3 database

    Hi,

    I cannot connect to database while running the “Getting started” example. How can I fix this? Thank you.

    Here is the full trace:

    Traceback (most recent call last):
    
    
    
     File "C:\Users\e173196\Anaconda projects\model_search\load_flags.py", line 32, in <module>
    
       trainer.try_models(
    
    
    
     File "C:\Users\e173196\Anaconda projects\model_search\model_search\single_trainer.py", line 57, in try_models
    
       phoenix_instance = phoenix.Phoenix(
    
    
    
     File "C:\Users\e173196\Anaconda projects\model_search\model_search\phoenix.py", line 239, in __init__
    
       self._metadata = ml_metadata_db.MLMetaData(phoenix_spec, study_name,
    
    
    
     File "C:\Users\e173196\Anaconda projects\model_search\model_search\metadata\ml_metadata_db.py", line 100, in __init__
    
       self._store = metadata_store.MetadataStore(self._connection_config)
    
    
    
     File "C:\Users\e173196\Anaconda3\envs\Model_search\lib\site-packages\ml_metadata\metadata_store\metadata_store.py", line 91, in __init__
    
       self._metadata_store = metadata_store_serialized.CreateMetadataStore(
    
    
    
    RuntimeError: Cannot connect sqlite3 database: unable to open database file
    
    
    opened by j850613enna 6
  • absl.flags._exceptions.UnparsedFlagAccessError: Trying to access flag --mlmd_default_sqllite_filename before flags were parsed

    absl.flags._exceptions.UnparsedFlagAccessError: Trying to access flag --mlmd_default_sqllite_filename before flags were parsed

    I get the error when I run the code snippet from the project page:

    Traceback (most recent call last): File "btc.py", line 14, in <module> trainer.try_models( File "/home/lasse/Development/projects/btcpred/model_search/model_search/single_trainer.py", line 56, in try_models phoenix_instance = phoenix.Phoenix( File "/home/lasse/Development/projects/btcpred/model_search/model_search/phoenix.py", line 239, in __init__ self._metadata = ml_metadata_db.MLMetaData(phoenix_spec, study_name, File "/home/lasse/Development/projects/btcpred/model_search/model_search/metadata/ml_metadata_db.py", line 84, in __init__ if FLAGS.mlmd_default_sqllite_filename: File "/home/lasse/Development/projects/btcpred/.env/lib/python3.8/site-packages/absl/flags/_flagvalues.py", line 498, in __getattr__ raise _exceptions.UnparsedFlagAccessError(error_message) absl.flags._exceptions.UnparsedFlagAccessError: Trying to access flag --mlmd_default_sqllite_filename before flags were parsed.

    opened by lsiem 6
  • UnparsedFlagAccessError

    UnparsedFlagAccessError

    Hi - What could be causing this?


    UnparsedFlagAccessError Traceback (most recent call last) in () 14 batch_size=32, 15 experiment_name="animalfaces", ---> 16 experiment_owner="myname")

    3 frames /usr/local/lib/python3.6/dist-packages/absl/flags/_flagvalues.py in getattr(self, name) 496 # get too much noise. 497 logging.error(error_message) --> 498 raise _exceptions.UnparsedFlagAccessError(error_message) 499 500 def setattr(self, name, value):

    UnparsedFlagAccessError: Trying to access flag --mlmd_default_sqllite_filename before flags were parsed.

    opened by iandoriath 3
  • RuntimeError: Cannot connect sqlite3 database: unable to open database file

    RuntimeError: Cannot connect sqlite3 database: unable to open database file

    To get started, I just ran the example code. Unfortunately I get a RuntimeError. Did anyone get the same error or has an idea to solve it? Thanks in advance!

    ============================CODE OUTPUT========================================

    2021-04-15 08:37:31.183727: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
    2021-04-15 08:37:31.184042: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
    Traceback (most recent call last):
      File "demo.py", line 55, in <module>
        experiment_owner="model_search_user")
      File "C:\...\model_search\model_search\single_trainer.py", line 65, in try_models
        metadata=None)
      File "C:\...t\model_search\model_search\phoenix.py", line 240, in __init__
        study_owner)
      File "C:\...\model_search\model_search\metadata\ml_metadata_db.py", line 105, in __init__
        self._store = metadata_store.MetadataStore(self._connection_config)
      File "C:\...7\AppData\Local\Programs\Python\Python37\lib\site-packages\ml_metadata\metadata_store\metadata_store.py", line 92, in __init__
        config.SerializeToString(), migration_options.SerializeToString())
    RuntimeError: Cannot connect sqlite3 database: unable to open database file
    

    EDIT1: Formating EDIT2: Changed VENV from python 3.7 to python 3.8 but didn't solve the problem

    opened by Raketenpete 2
  • KeyError: 0

    KeyError: 0

    I'm trying to run the example provided by the tool in the README file. After many fixed error, I have found this one and I have no solution.

    The error

    Traceback (most recent call last):
      File "d:/Tesi_Magistrale/google_model_search/test.py", line 14, in <module>
        trainer.try_models(
      File "d:\Tesi_Magistrale\google_model_search\model_search\single_trainer.py", line 56, in try_models
        phoenix_instance = phoenix.Phoenix(
      File "d:\Tesi_Magistrale\google_model_search\model_search\phoenix.py", line 244, in __init__
        self._controller = controller.InProcessController(
      File "d:\Tesi_Magistrale\google_model_search\model_search\controller.py", line 147, in __init__
        self._search_candidate_generator = SearchCandidateGenerator(
      File "d:\Tesi_Magistrale\google_model_search\model_search\generators\search_candidate_generator.py", line 57, in __init__
        self._search_algorithm = search_algorithms[phoenix_spec.search_type]
    KeyError: 0
    

    The code I'm running

    import model_search
    from model_search import constants
    from model_search import single_trainer
    from model_search.data import csv_data
    
    trainer = single_trainer.SingleTrainer(
        data=csv_data.Provider(
        label_index=0,
        logits_dimension=2,
        record_defaults=[0, 0, 0, 0],
        filename="model_search/data/testdata/csv_random_data.csv"),
        spec=constants.DEFAULT_DNN)
    
    trainer.try_models(
        number_models=200,
        train_steps=1000,
        eval_steps=100,
        root_dir="/tmp/run_example",
        batch_size=32,
        experiment_name="example",
        experiment_owner="model_search_user")
    

    I have no idea on what I need to check for the resolution.

    opened by RygarNelson 2
  • NewRandomAccessFile failed to Create/Open

    NewRandomAccessFile failed to Create/Open

    NotFoundError: NewRandomAccessFile failed to Create/Open: model_search/model_search/configs/dnn_config.pbtxt : The system cannot find the path specified. ; No such process

    It seems like the path "model_search" was imported twice...Any idea how to solve it? Thanks in advance!

    opened by Shoot-to-root 2
  • UnicodedecodeErroe

    UnicodedecodeErroe

    Hi Guys, Im facing this error when trying to reproduce the example provided by you, I'm using the testdata provided here as well... Anyone knows what could be happening? image

    Thank you very much!

    opened by anaptoro 1
  •  AttributeError: module 'ml_metadata.metadata_store' has no attribute 'MetadataStore'

    AttributeError: module 'ml_metadata.metadata_store' has no attribute 'MetadataStore'

    I encountered this error when I run the example on my jupyter notebook: AttributeError: module 'ml_metadata.metadata_store' has no attribute 'MetadataStore'. Appreciate any advice on how to fix this issue. Thank you.

    opened by mmtan 1
  • InvalidArgumentError: Field 1 in record is not a valid int32

    InvalidArgumentError: Field 1 in record is not a valid int32

    I was able to get the code running with the test data supplied with the module. Now, I am testing out the code with a custom dataset. However, the dataset isn't just composed of int32 entries but also has float entries. This is probably causing the following error: InvalidArgumentError: Field 1 in record is not a valid int32: 1.0000000007063299 Could you help me fix it? Is there a keyword in the csvdata module that will accommodate for floating point numbers in the inputs?

    The full error trace is below:

    `InvalidArgumentError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args) 1374 try: -> 1375 return fn(*args) 1376 except errors.OpError as e:

    20 frames /usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py in _run_fn(feed_dict, fetch_list, target_list, options, run_metadata) 1359 return self._call_tf_sessionrun(options, feed_dict, fetch_list, -> 1360 target_list, run_metadata) 1361

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py in _call_tf_sessionrun(self, options, feed_dict, fetch_list, target_list, run_metadata) 1452 fetch_list, target_list, -> 1453 run_metadata) 1454

    InvalidArgumentError: Field 1 in record is not a valid int32: 1.0000000007063299 [[{{node IteratorGetNext}}]]

    During handling of the above exception, another exception occurred:

    InvalidArgumentError Traceback (most recent call last) in () 31 batch_size=32, 32 experiment_name="example", ---> 33 experiment_owner="model_search_user")

    /content/drive/My Drive/oqmd_structures/sony/search/model_search/single_trainer.py in try_models(self, number_models, train_steps, eval_steps, root_dir, batch_size, experiment_name, experiment_owner) 84 train_steps=train_steps, 85 eval_steps=eval_steps, ---> 86 batch_size=batch_size): 87 pass

    /content/drive/My Drive/oqmd_structures/sony/search/model_search/oss_trainer_lib.py in run_parameterized_train_and_eval(phoenix_instance, oracle, tuner_id, root_dir, max_trials, data_provider, train_steps, eval_steps, batch_size) 338 train_steps=train_steps, 339 eval_steps=eval_steps, --> 340 batch_size=batch_size) 341 342 oracle.update_trial(

    /content/drive/My Drive/oqmd_structures/sony/search/model_search/oss_trainer_lib.py in run_train_and_eval(hparams, model_dir, phoenix_instance, data_provider, train_steps, eval_steps, batch_size) 240 mode=tf.estimator.ModeKeys.TRAIN, 241 batch_size=batch_size), --> 242 max_steps=train_steps) 243 tf.compat.v1.reset_default_graph() 244 tf.keras.backend.clear_session()

    /usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py in train(self, input_fn, hooks, steps, max_steps, saving_listeners) 347 348 saving_listeners = _check_listeners_type(saving_listeners) --> 349 loss = self._train_model(input_fn, hooks, saving_listeners) 350 logging.info('Loss for final step: %s.', loss) 351 return self

    /usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py in _train_model(self, input_fn, hooks, saving_listeners) 1173 return self._train_model_distributed(input_fn, hooks, saving_listeners) 1174 else: -> 1175 return self._train_model_default(input_fn, hooks, saving_listeners) 1176 1177 def _train_model_default(self, input_fn, hooks, saving_listeners):

    /usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py in _train_model_default(self, input_fn, hooks, saving_listeners) 1206 return self._train_with_estimator_spec(estimator_spec, worker_hooks, 1207 hooks, global_step_tensor, -> 1208 saving_listeners) 1209 1210 def _train_model_distributed(self, input_fn, hooks, saving_listeners):

    /usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py in _train_with_estimator_spec(self, estimator_spec, worker_hooks, hooks, global_step_tensor, saving_listeners) 1512 any_step_done = False 1513 while not mon_sess.should_stop(): -> 1514 _, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss]) 1515 any_step_done = True 1516 if not any_step_done:

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/training/monitored_session.py in run(self, fetches, feed_dict, options, run_metadata) 776 feed_dict=feed_dict, 777 options=options, --> 778 run_metadata=run_metadata) 779 780 def run_step_fn(self, step_fn):

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/training/monitored_session.py in run(self, fetches, feed_dict, options, run_metadata) 1281 feed_dict=feed_dict, 1282 options=options, -> 1283 run_metadata=run_metadata) 1284 except _PREEMPTION_ERRORS as e: 1285 logging.info(

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/training/monitored_session.py in run(self, *args, **kwargs) 1382 raise six.reraise(*original_exc_info) 1383 else: -> 1384 raise six.reraise(*original_exc_info) 1385 1386

    /usr/local/lib/python3.7/dist-packages/six.py in reraise(tp, value, tb) 701 if value.traceback is not tb: 702 raise value.with_traceback(tb) --> 703 raise value 704 finally: 705 value = None

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/training/monitored_session.py in run(self, *args, **kwargs) 1367 def run(self, *args, **kwargs): 1368 try: -> 1369 return self._sess.run(*args, **kwargs) 1370 except _PREEMPTION_ERRORS: 1371 raise

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/training/monitored_session.py in run(self, fetches, feed_dict, options, run_metadata) 1440 feed_dict=feed_dict, 1441 options=options, -> 1442 run_metadata=run_metadata) 1443 1444 for hook in self._hooks:

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/training/monitored_session.py in run(self, *args, **kwargs) 1198 1199 def run(self, *args, **kwargs): -> 1200 return self._sess.run(*args, **kwargs) 1201 1202 def run_step_fn(self, step_fn, raw_session, run_with_hooks):

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata) 966 try: 967 result = self._run(None, fetches, feed_dict, options_ptr, --> 968 run_metadata_ptr) 969 if run_metadata: 970 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata) 1189 if final_fetches or final_targets or (handle and feed_dict_tensor): 1190 results = self._do_run(handle, final_targets, final_fetches, -> 1191 feed_dict_tensor, options, run_metadata) 1192 else: 1193 results = []

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata) 1367 if handle is None: 1368 return self._do_call(_run_fn, feeds, fetches, targets, options, -> 1369 run_metadata) 1370 else: 1371 return self._do_call(_prun_fn, handle, feeds, fetches)

    /usr/local/lib/python3.7/dist-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args) 1392 '\nsession_config.graph_options.rewrite_options.' 1393 'disable_meta_optimizer = True') -> 1394 raise type(e)(node_def, op, message) 1395 1396 def _extend_graph(self):

    InvalidArgumentError: Field 1 in record is not a valid int32: 1.0000000007063299 [[node IteratorGetNext (defined at /usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/util.py:61) ]]

    Errors may have originated from an input operation. Input Source operations connected to node IteratorGetNext: IteratorV2 (defined at /usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/util.py:59)

    Original stack trace for 'IteratorGetNext': File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py", line 16, in app.launch_new_instance() File "/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py", line 845, in launch_instance app.start() File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelapp.py", line 499, in start self.io_loop.start() File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 132, in start self.asyncio_loop.run_forever() File "/usr/lib/python3.7/asyncio/base_events.py", line 541, in run_forever self._run_once() File "/usr/lib/python3.7/asyncio/base_events.py", line 1786, in _run_once handle._run() File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py", line 122, in _handle_events handler_func(fileobj, events) File "/usr/local/lib/python3.7/dist-packages/tornado/stack_context.py", line 300, in null_wrapper return fn(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 451, in _handle_events self._handle_recv() File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv self._run_callback(callback, msg) File "/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py", line 434, in _run_callback callback(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/tornado/stack_context.py", line 300, in null_wrapper return fn(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 283, in dispatcher return self.dispatch_shell(stream, msg) File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 233, in dispatch_shell handler(stream, idents, msg) File "/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py", line 399, in execute_request user_expressions, allow_stdin) File "/usr/local/lib/python3.7/dist-packages/ipykernel/ipkernel.py", line 208, in do_execute res = shell.run_cell(code, store_history=store_history, silent=silent) File "/usr/local/lib/python3.7/dist-packages/ipykernel/zmqshell.py", line 537, in run_cell return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2718, in run_cell interactivity=interactivity, compiler=compiler, result=result) File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2828, in run_ast_nodes if self.run_code(code, result): File "/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py", line 2882, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 33, in experiment_owner="model_search_user") File "search/model_search/single_trainer.py", line 86, in try_models batch_size=batch_size): File "search/model_search/oss_trainer_lib.py", line 340, in run_parameterized_train_and_eval batch_size=batch_size) File "search/model_search/oss_trainer_lib.py", line 242, in run_train_and_eval max_steps=train_steps) File "/usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 349, in train loss = self._train_model(input_fn, hooks, saving_listeners) File "/usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1175, in _train_model return self._train_model_default(input_fn, hooks, saving_listeners) File "/usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1201, in _train_model_default self._get_features_and_labels_from_input_fn(input_fn, ModeKeys.TRAIN)) File "/usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/estimator.py", line 1037, in _get_features_and_labels_from_input_fn self._call_input_fn(input_fn, mode)) File "/usr/local/lib/python3.7/dist-packages/tensorflow_estimator/python/estimator/util.py", line 61, in parse_input_fn_result result = iterator.get_next() File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/data/ops/iterator_ops.py", line 419, in get_next name=name) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/gen_dataset_ops.py", line 2601, in iterator_get_next output_shapes=output_shapes, name=name) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 750, in _apply_op_helper attrs=attr_protos, op_def=op_def) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py", line 3536, in _create_op_internal op_def=op_def) File "/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/ops.py", line 1990, in init self._traceback = tf_stack.extract_stack()`

    opened by hitarth64 1
  • ImportError: cannot import name 'hparam_pb2' from 'model_search.proto' (unknown location)

    ImportError: cannot import name 'hparam_pb2' from 'model_search.proto' (unknown location)

    from model_search import oss_trainer_lib Traceback (most recent call last): File "", line 1, in File "E:\src\model_search\model_search\oss_trainer_lib.py", line 28, in from model_search import hparam as hp File "E:\src\model_search\model_search\hparam.py", line 26, in from model_search.proto import hparam_pb2 ImportError: cannot import name 'hparam_pb2' from 'model_search.proto' (unknown location)

    opened by dghlnvyps 1
  • Project dependencies may have API risk issues

    Project dependencies may have API risk issues

    Hi, In model_search, inappropriate dependency versioning constraints can cause risks.

    Below are the dependencies and version constraints that the project is using

    six==1.15.0
    sklearn==0.0
    tensorflow==2.6.0
    tensorflow-estimator==2.6.0
    keras==2.6.0
    absl-py==0.10.0
    tf-slim==1.1.0
    ml-metadata==0.26.0
    keras-tuner==1.0.3
    mock==4.0.3
    

    The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

    After further analysis, in this project, The version constraint of dependency six can be changed to >=1.5.0,<=1.6.1. The version constraint of dependency keras-tuner can be changed to >=1.0.3,<=1.1.3.

    The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

    The invocation of the current project includes all the following methods.

    The calling methods from the six
    six.iteritems
    
    The calling methods from the keras-tuner
    keras_tuner.HyperParameters
    keras_tuner.oracles.BayesianOptimizationOracle
    keras_tuner.HyperParameters.Choice
    keras_tuner.HyperParameters.Int
    keras_tuner.oracles.RandomSearchOracle
    keras_tuner.HyperParameters.merge
    keras_tuner.HyperParameters.Float
    
    The calling methods from the all methods
    absl.logging.warning
    _pad_to_match
    model.fit.fit
    AssertionError
    _merge_hparams.keys
    self._discount
    level.startswith
    self.get_polynomial_expansion.fill
    has_distillation
    self.batch_sample
    search_tower.hparams.CopyFrom
    numpy.random.randint
    input_layer_fn
    self._add_residual_connection
    absl.flags.DEFINE_float
    self._default_metric_fn_list.append
    _compute_tolerance
    tensorflow.compat.v2.compat.v1.layers.dropout
    tensorflow.compat.v2.compat.v1.logging.warning
    numpy.random.random
    _reuse_fail
    tensorflow.compat.v2.reshape
    self.get_polynomial_expansion.append
    NotImplementedError
    model_search.oss_trainer_lib.run_parameterized_train_and_eval
    self._save_architecture
    model_search.phoenix.Phoenix.get_estimator
    self.values
    suggest_and_create_architecture_fn
    metrics_dict.update
    as_bytes
    self._store.put_execution_type
    sklearn.preprocessing.OneHotEncoder
    set_parameter
    tensorflow.compat.v2.compat.v1.train.get_or_create_global_step
    lstm1.tf.keras.layers.RNN
    tensorflow.compat.v2.clip_by_global_norm
    inspect.isfunction
    _contains_row
    tensorflow.compat.v2.nn.bias_add
    sklearn.linear_model.Ridge
    init_variables
    ml_metadata.proto.metadata_store_pb2.ConnectionConfig
    issubclass
    tensorflow.compat.v1.keras.activations.serialize
    TypeError
    self.SearchCandidateGenerator.super.__init__
    tensorflow.python.feature_column.feature_column_lib.is_feature_column_v2
    as_str
    generators.keys
    tensorflow.compat.v1.expand_dims
    self.Estimator.super.evaluate.items
    kwargs.get
    self._kernel_size.tf.keras.layers.AveragePooling2D
    self._ensembler.bundle_logits
    self._add_projection_if_needed.get_shape
    tensorflow.compat.v2.compat.v1.tpu.CrossShardOptimizer
    towers.items
    set
    ml_metadata.metadata_store.MetadataStore
    scope.block_type.block_builder.BlockType.blocks.get_new
    tensorflow.compat.v2.keras.optimizers.SGD
    numpy.copy
    range
    tensorflow.compat.v2.nn.relu
    model_search.architecture.architecture_utils.construct_tower
    self.SvdfConvLayer.super.get_config
    self._kernel_size.tf.keras.layers.MaxPool2D
    reductions.append
    loss_fn
    getattr
    model_search.ensembler.Ensembler
    self._get_user_suggestion
    curve.lower
    activations.get_shape
    numpy.empty
    self._get_polynomial_expansion
    tensorflow.compat.v1.reshape
    input_indices_padded_np.tolist.append
    _make_auc_metric_fn
    coefficients.assignments.np.matmul.np.square.reshape
    model_search.registry.lookup_all
    ModelSearchTuner.search
    values_dict.items
    model_search.search.linear_model.LinearModel
    model_search.ops.svdf_cell.SvdfCell
    model_search.architecture.architecture_utils.get_architecture.copy
    get_hparams_from_dir
    search_space.np.meshgrid.np.array.T.reshape
    enum.IntEnum
    self._get_loss_fn
    get_dataset_provider.get_input_fn
    self._projection_size.tf.keras.layers.Dense
    tensorflow.compat.v2.feature_column.numeric_column
    input_tensors.get_shape.as_list
    input_tensor.get_shape.as_list
    hparam_def.hparam.items
    self._combine_previous_trial_variables
    var.assign
    self._init_from_proto
    self.generator_name
    model_search.oss_trainer_lib.loss_and_metric_and_predictions_fn
    model_search.search.common.write_fork_edge
    svdf_conv_layer
    FLAGS.is_parsed
    self._create_task_spec
    towers.values
    get_architecture
    absl.logging.info
    self.FullyConnectedPyramidBlock.super.__init__
    self._add_reduction_blocks
    tensorflow.compat.v1.keras.backend.dropout
    setattr
    tensorflow.compat.v2.lookup.StaticVocabularyTable.lookup
    json.loads
    Task.add_initialization
    generator_name.task_towers.append
    output.update
    model_search.hparam.HParams.from_proto
    tensorflow.compat.v2.compat.v1.assign
    model_search.hparams.hyperparameters.Hyperparameters
    model_search.generators.trial_utils.is_adaptive_ensemble_search
    replay_spec.replay.towers.add
    self.get_feature_columns
    tensorflow.compat.v2.keras.layers.MaxPool2D
    InputSelector
    numpy.arange
    model_search.metric_fns.combine_metric_fns
    tensorflow.compat.v2.io.gfile.makedirs
    self.IncreaseChannelsBlock.super.__init__
    shape.as_list.as_list
    cmath.exp
    features_dataset.repeat.shuffle
    dataset.cache.prefetch
    optimizer._OPTIMIZERS
    inspect.isclass
    self._head.loss
    extract_task_specific
    previous_architecture.copy
    model_search.block_builder.Blocks
    model_search.meta.distillation.Distiller
    numpy.flatnonzero
    numpy.unique
    model_search.architecture.architecture_utils.get_parameter
    keras_tuner.oracles.BayesianOptimizationOracle._set_project_dir
    train_losses.append
    train_dataset.cache.prefetch
    self._kernel_rank.tf.keras.layers.Dense
    self._task_manager.create_model_spec
    keras_tuner.oracles.BayesianOptimizationOracle.update_trial
    kind.name.hparam_proto.hparam.getattr.value.extend
    lstm.tf.keras.layers.RNN
    self.build_priors_distillation
    model_search.utils.last_activations_in_sequence
    registry.items
    model_search.architecture.architecture_utils.set_parameter
    self._metadata.after_generating_trial_model
    self.Tower.super.__init__
    model_search.hparams.hyperparameters.Hyperparameters.merge
    self.RnnBlock.super.__init__
    tensorflow.compat.v2.keras.layers.Conv2D
    tensorflow.compat.v2.keras.layers.AveragePooling2D
    task_tower
    tensorflow.compat.v2.compat.v1.nn.dynamic_rnn
    format
    self._remove_reduction_blocks
    tensorflow.compat.v2.strided_slice
    self.override_from_dict
    tensorflow.compat.v2.lookup.StaticVocabularyTable
    tensorflow.compat.v2.unstack
    os.path.join
    features_dataset.repeat.shuffle.repeat
    tensorflow.compat.v2.compat.v1.get_collection.items
    block_types_np.tolist.append
    model_search.proto.hparam_pb2.HParamDef
    phoenix_instance.get_estimator.export_saved_model
    keras_tuner.oracles.BayesianOptimizationOracle.end_trial
    tensorflow.compat.v2.compat.v1.train.SyncReplicasOptimizer.make_session_run_hook
    numpy.insert
    self.get_trial_dir
    GeneratorWithTrials
    name.split
    model_search.task_manager.TaskManager
    model_search.phoenix.Phoenix.get_tpu_estimator
    tensorflow.compat.v2.compat.v1.summary.image
    hooks_list.extend
    model_search.generators.trial_utils.write_replay_spec
    model_search.generators.trial_utils.is_residual_ensemble_search
    tensorflow.compat.v2.compat.v1.global_variables
    model_search.generators.prior_generator.PriorGenerator
    node.block_builder.block_build
    session.run
    tensorflow.compat.v2.compat.v1.placeholder
    self._dilation_rate.self._kernel_size.input_tensor.get_channel_dim.tf.keras.layers.Conv2D
    cls.LogitsSpec.super.__new__
    _merge_hparams
    increase_structure_depth
    LogitsSpec
    HParams._get_kind_name
    self.AveragePoolBlock.super.__init__
    numpy.abs
    self._load_trials
    model_search.data.data.register_provider
    self.create_logits_spec
    numpy.random.seed
    keras_tuner.HyperParameters.Choice
    replay_spec.replay.towers.add.CopyFrom
    self._write_model
    learning_rate_spec.get
    logits.get_shape.as_list
    ReplayState
    run_keras_parameterized_train_and_eval
    get_dataset_provider.get_serving_input_fn
    self.SvdfConvLayer.super.__init__
    get_dataset_provider.number_of_classes
    self._replay_state.replay_is_training_a_tower
    _add_projection_if_needed
    msg.format
    tensorflow.compat.v2.size
    predictions_fn
    no_partion_map.keys
    tensorflow.compat.v2.reduce_mean
    self.SvdfConvLayer.super.get_config.items
    model_search.architecture.tower.Tower
    absl.flags.mark_flag_as_required
    model_search.block_builder.Blocks.get_new
    model_search.search.common.get_allowed_depth
    staticmethod
    self.translate_architecture_to_feature_assignment
    IdentityCombiner
    provider.get_predictions_fn
    model_search.generators.trial_utils.get_trial_mode
    self.DualResnetBlock.super.__init__
    self._pad_architecture
    keras_tuner.HyperParameters.merge
    self.Block.super.__init__
    varscope.reuse_variables
    encoder.fit_transform.reshape
    absl.flags.DEFINE_string
    tensorflow.compat.v2.compat.v1.reset_default_graph
    super
    tensorflow.compat.v2.errors.FailedPreconditionError
    train_hooks_list.extend
    self._metadata.get_completed_trials
    tensorflow.compat.v2.compat.v1.metrics.accuracy
    model_search.generators.trial_utils.get_intermixed_trials
    keras_tuner.oracles.BayesianOptimizationOracle.update_space
    numpy.array.pop
    tensorflow.compat.v2.loggin.warning
    coefficients.assignments.np.matmul.np.square.reshape.sum
    shape_maps.append
    task_spec_list.append
    model_search.architecture.architecture_utils.get_tower_variables
    tensorflow.compat.v2.estimator.export.build_raw_serving_input_receiver_fn
    model_search.architecture.architecture_utils.get_hparams_from_dir
    phoenix_instance.get_estimator.evaluate
    Task.get_task
    self.FixedOutputFullyConnectedBlock.super.__init__
    self._controller.get_generators
    delattr
    towers.append
    model_search.generators.replay_generator.ReplayGenerator
    cls.ModelSpec.super.__new__
    train_op_list.extend
    _cast_to_type_if_compatible
    tensorflow.compat.v2.keras.backend.clear_session
    self._create_weighted_ensemble_logits
    self.BottleNeckBlock.super.__init__
    modes.append
    model_search.data.utils.default_get_input_layer_fn
    tensorflow.compat.v1.keras.initializers.get
    ModelSpec
    self.block_build
    self._pool_size.tf.keras.layers.MaxPool2D
    self.build_priors_nonadaptively
    self.BidirectionalLSTMBlock.super.__init__
    tensorflow.compat.v2.compat.v1.train.SyncReplicasOptimizer
    copy.deepcopy
    _one_nonzero_per_row
    self._add_projection_if_needed
    tensorflow.compat.v2.compat.v1.zeros_initializer
    tensorflow.compat.v2.data.experimental.AUTOTUNE._map_fn.features_dataset.map.prefetch.batch
    any
    numpy.argmin
    self._store.get_executions_by_type
    inspect.getargspec
    tensorflow.compat.v2.train.latest_checkpoint
    tensorflow.compat.v2.keras.optimizers.Adagrad
    model_search.architecture.architecture_utils.increase_structure_depth
    _merge_hparams.override_from_dict
    f.read.split
    random.randint
    self._kernel_size.input_tensor.get_channel_dim.tf.keras.layers.Conv2D
    self._stride.self._kernel_size.self._num_filters.tf.keras.layers.Conv2D
    tensorflow.compat.v2.stack
    keras_tuner.oracles.BayesianOptimizationOracle.create_trial
    tensorflow.compat.v2.cast
    input_tensors.get_shape
    _json_to_python_object
    model_search.architecture.architecture_utils.LogitsSpec
    provider.get_metric_fn
    tensorflow.compat.v2.compat.v1.estimator.tpu.TPUEstimator
    tensorflow.compat.v2.compat.v1.train.SyncReplicasOptimizer.apply_gradients
    init_args.update
    numpy.matmul
    towers.compile
    tensorflow.compat.v2.nn.conv1d
    filter
    self._hparam_types.keys
    tensorflow.compat.v2.io.gfile.rmtree
    absl.flags.DEFINE_integer
    self._metadata.get_best_k
    self.first_time_chief_generate
    tensorflow.compat.v2.nn.log_softmax
    sorted
    hparams.values.items
    tensorflow.compat.v2.math.log1p
    tensorflow.compat.v2.control_dependencies
    tensorflow.compat.v2.compat.v1.losses.sigmoid_cross_entropy
    tensorflow.compat.v2.compat.v1.name_scope
    self.SvdfConvLayer.super.build
    tensorflow.compat.v1.keras.backend.squeeze
    self._activation
    tensorflow.compat.v2.keras.optimizers.schedules.PiecewiseConstantDecay
    _merge_hparams.copy
    y.append
    self.Task.super.call
    tensorflow.compat.v2.compat.v1.train.init_from_checkpoint
    all
    kwargs.lower
    tensorflow.compat.v2.nn.l2_loss
    numpy.array
    self.ModelSearchTuner.super.run_trial
    model_search.registry.get_base_enum.update
    scope_name.is_training.feature_columns.tf.keras.experimental.SequenceFeatures
    bool
    model_search.architecture.architecture_utils.DirectoryHandler.trial_dir
    model_search.generators.trial_utils.non_adaptive_or_intermixed_ensemble
    numpy.concatenate
    tensorflow.compat.v2.shape
    has_ensemble_search
    os.path.basename
    model.fit.predict
    model_search.generators.trial_utils.adaptive_or_residual_ensemble
    generator.instance.generate.add_feature_columns_input_layer
    f.write
    self.keras_model_builder
    self._store.put_executions
    model_search.registry.get_base_enum
    input_indices_lengths_np.tolist.append
    get_trial_dir
    self.ReplayGenerator.super.__init__
    model_search.search.constrained_descent.ConstrainedDescent
    get_hparams_from_dir.values
    lstm2.tf.keras.layers.RNN
    tensorflow.compat.v1.keras.initializers.serialize
    tower
    model_search.generators.trial_utils.import_towers_one_trial
    cls.GeneratorWithTrials.super.__new__
    tensorflow.compat.v2.train.load_checkpoint.has_tensor
    ml_metadata.proto.metadata_store_pb2.Execution
    is_adaptive_ensemble_search
    get_dataset_provider.get_keras_input
    tensorflow.compat.v2.keras.preprocessing.image_dataset_from_directory
    sklearn.linear_model.Lasso
    tensorflow.compat.v2.compat.v1.losses.absolute_difference
    tensorflow.compat.v2.compat.v1.estimator.tpu.RunConfig
    _default_depth_thresholds
    self._metadata.before_generating_trial_model
    hasattr
    _get_optimizer_fn
    task.name.predictions_fn.extract_task_specific.items
    enumerate
    model_search.metric_fns.make_auc_roc_metric_fn
    rnn_cell.tf.keras.layers.RNN
    readers.append
    all_layers.append
    cls.TowerSpec.super.__new__
    self._filename.replace
    tensorflow.compat.v2.matmul
    RuntimeError
    overrides.values
    model_search.architecture.architecture_utils.set_number_of_towers
    keras_tuner.oracles.BayesianOptimizationOracle
    os.environ.get
    os.path.dirname
    re.split
    self._head.create_loss
    self.GeneralBlock.super.__init__
    model_search.metadata.trial.get_best_k
    tensorflow.compat.v2.train.load_checkpoint
    model_search.architecture.architecture_utils.init_variables
    Estimator
    self.Tower.super.save
    towers.keys
    self.set_hparam
    Node
    keras_tuner.oracles.BayesianOptimizationOracle.save
    self._run_svdf_conv_calculation
    self.SvdfBlock.super.__init__
    model_search.search.coordinate_descent.CoordinateDescent
    tensorflow.compat.v2.compat.v1.constant_initializer
    parse_values
    outputs.get_shape.as_list
    _map_fn.features_dataset.map.prefetch
    model_search.hparam.HParams.to_proto
    tensorflow.compat.v2.math.argmax
    HParams
    pandas.read_csv
    tensorflow.compat.v2.compat.v1.Session.reset
    self._increment_global_step
    architecture.copy.append
    model_search.search.common.get_random_block
    absl.flags.DEFINE_bool
    model_search.search.common.random
    pre_logits.get_shape.as_list
    model_search.ops.svdf_conv.SvdfConvLayer
    net.get_shape.max.max_output_size.min.tf.keras.layers.Dense
    value.items
    tensorflow.compat.v2.concat.get_shape
    numpy.random.choice
    self.bn_scale.tf.keras.layers.BatchNormalization
    zip
    tensorflow.compat.v2.keras.optimizers.Adam
    self._create_average_ensemble_logits
    tensorflow.compat.v2.compat.v1.get_variable
    tensorflow.compat.v2.data.experimental.CsvDataset
    google.protobuf.text_format.Parse
    pandas.read_csv.pop
    relevant_variables.extend
    numpy.percentile
    HParams._get_kind_name.startswith
    self.Task.super.__init__
    spec._replace
    loss2_fn
    i.item
    self.FixedChannelConvolutionBlock.super.__init__
    pre_logits.get_shape
    isinstance
    tensorflow.compat.v2.nn.softmax
    self._strides.self._kernel_size.self._max_channels.net.get_channel_dim.min.tf.keras.layers.Conv2D
    self.save_to_graph
    tensorflow.compat.v1.keras.backend.sum
    inputs.get_shape.as_list
    outputs.get_shape.as_list.tf.keras.layers.Dense
    tensorflow.compat.v2.pad
    self.get_polynomial_expansion
    tensorflow.compat.v1.keras.backend.temporal_padding
    tensorflow.compat.v2.compat.v1.trainable_variables
    tensorflow.compat.v2.compat.v1.disable_eager_execution
    self._phoenix_spec.HasField
    tensorflow.compat.v2.constant
    overrides.values.items
    self._metric_fn
    d.keys.collections.namedtuple
    tensorflow.compat.v2.train.load_checkpoint.get_tensor
    tensorflow.compat.v2.compat.v1.variable_scope
    tensorflow.compat.v1.keras.activations.get
    tensorflow.compat.v2.transpose
    get_random_block
    self._convert_to_trial_object
    ValueError
    reader.get_tensor.tolist
    tensorflow.compat.v2.keras.layers.Flatten.get_shape
    type
    self._output_size.tf.keras.layers.Dense
    train_op_fn
    max
    tensorflow.compat.v1.nn.depthwise_conv2d
    model_search.generators.trial_utils.is_intermixed_ensemble_search
    inspect.signature
    model_search.phoenix.Phoenix.get_keras_hyperparameters_space
    numpy.asarray
    _merge_train_op_list
    d.values
    sklearn.linear_model.Lasso.fit
    labels.items
    tensorflow.compat.v2.train.load_checkpoint._GetVariableToDataTypeMap
    absl.logging.vlog
    t_dir.os.path.basename.isdigit
    tensorflow.compat.v1.add
    loss_and_metric_and_predictions_fn
    sklearn.preprocessing.OneHotEncoder.fit_transform
    self._metadata.unblock_stopped_infeasible_trial
    _merge_hparams.add_hparam
    tensorflow.compat.v1.keras.activations.serialize.items
    get_dataset_provider
    tensorflow.compat.v2.lookup.KeyValueTensorInitializer
    register_block
    architectures.append
    strip_scope
    tensorflow.compat.v1.keras.backend.in_train_phase
    get_parameter
    tensorflow.compat.v1.keras.layers.InputSpec
    model_search.search.common.get_random_architecture
    child_metric_fn
    self.Estimator.super.evaluate
    value.WhichOneof
    google.protobuf.text_format.Merge
    self.add_hparam
    self._get_trial_from_id
    numpy.amax
    self._get_allowed_depth
    Tower.add_initialization
    provider.get_loss_fn
    join
    model_search.search.categorical_harmonica.Harmonica
    task.name.predictions_fn.extract_task_specific
    model_search.hparam.HParams.set_hparam
    filters.get_shape
    six.iteritems
    self._exists
    bytes_or_text.encode
    set_architecture
    tensorflow.compat.v2.keras.layers.Dense
    self._get_svdf_conv_output
    self.Conv1DBlock.super.__init__
    model_search.search.common.choose_random_trial_and_get_architecture
    PolynomialFeatures
    tensorflow.compat.v2.compat.v1.train.exponential_decay
    node.combiner
    absl.logging.fatal
    parse_fn
    str
    tensorflow.compat.v1.keras.layers.BatchNormalization
    tensorflow.compat.v2.range
    train_op_list.append
    self.keras_compile
    generator.instance.generate.has_input_tensor
    collections.namedtuple
    self.DilatedConvolutionBlock.super.__init__
    directory.split
    tensorflow.compat.v2.keras.optimizers.RMSprop
    tensorflow.compat.v2.gather
    is_training.fc_v2.tf.keras.layers.DenseFeatures
    onehot_best.encoder.inverse_transform.flatten
    self._assign_ops.append
    self.values.items
    var_name.replace
    tensorflow.compat.v2.compat.v1.metrics.auc
    tensorflow.compat.v2.expand_dims.get_shape
    float
    run_train_and_eval
    model_search.block_builder.BlockType
    tensorflow.compat.v2.train.load_checkpoint.get_variable_to_shape_map
    generator.instance.generate
    dimension.tf.keras.layers.Dense
    numpy.argsort
    self.LSTMBlock.super.__init__
    model_search.ensembler.EnsembleLogits
    self.DownsampleConvolutionBlock.super.__init__
    self._input_dir.replace
    tensorflow.compat.v2.minimum
    model_search.phoenix.Phoenix
    self._hparam_types.items
    model_search.generators.search_candidate_generator.SearchCandidateGenerator
    FLAGS.record_defaults.split
    self._sort_previous_trial_variables
    is_intermixed_ensemble_search
    tensorflow.compat.v2.compat.v1.estimator.tpu.TPUConfig
    tensorflow.compat.v1.executing_eagerly
    _generate_dropout_mask
    self._oracle._set_project_dir
    results_dictionary.get
    model_search.generators.trial_utils.import_towers_multiple_trials
    _merge_hparams.set_hparam
    numpy.meshgrid
    model_search.architecture.architecture_utils.get_blocks_search_space
    output_tensor.shape.tf.keras.layers.Dense
    tensorflow.compat.v2.compat.v1.assign_add
    self._get_svdf_rnn_cell_output
    logits_dimension.tf.keras.layers.Dense
    param_type
    model_search.search.common.block_indices
    train_hooks.append
    Task.load
    tensorflow.compat.v1.shape
    tf_slim.fully_connected
    self._distiller.bundle_logits
    next
    tuple
    six.moves.range
    model_search.data.utils.default_get_keras_input_layer_fn
    modes.sort
    hparams.projection_size.tf.keras.layers.Dense
    _process_scalar_value
    model_search.search.identity.Identity
    self.PriorGenerator.super.__init__
    phoenix_instance.get_estimator.train
    bytes_or_text.decode
    self.build_priors_adaptively
    phoenix_spec.HasField
    model_search.registry.lookup
    numpy.append
    tensorflow.compat.v2.convert_to_tensor
    tensorflow.compat.v2.compat.v1.layers.conv1d
    self.FullyConnectedBlock.super.__init__
    tensorflow.compat.v2.keras.experimental.SequenceFeatures
    self.get_train_and_eval_logits
    var_name.endswith
    collections.defaultdict
    model_search.hparam.HParams
    inputs.get_shape
    losses.append
    input_key_b.decode
    model_search.proto.phoenix_spec_pb2.PhoenixSpec.HasField
    os.path.basename.isdigit
    get_block_hparams
    create_tower_spec
    is_residual_ensemble_search
    self.MaxPoolingBlock.super.__init__
    result.append
    json.dumps
    copy.deepcopy.ClearField
    self._replay_state.replay_is_importing_towers
    tensorflow.compat.v2.config.run_functions_eagerly
    tensorflow.compat.v2.reduce_sum
    supply_params_if_needed
    model_search.generators.trial_utils.has_distillation
    final_args.update
    model_search.architecture.tower.Tower.load
    train_dataset.cache.prefetch.cache
    ModelSearchTuner
    self.DownsampleFlattenBlock.super.__init__
    model_search.search.common.mutate_replace
    model_search.metric_fns.make_accuracy_metric_fn
    model_search.controller.InProcessController
    tensorflow.compat.v2.expand_dims
    absl.flags.DEFINE_enum
    map
    tensorflow.compat.v2.keras.layers.RNN
    bytes
    tensorflow.compat.v2.keras.layers.DenseFeatures
    tensorflow.compat.v2.keras.layers.Conv1D
    model_search.metric_fns.create_num_parameters_metric_fn
    int
    ConcatCombiner
    self._wait_for_chief
    architecture.tolist
    absl.app.run
    TaskSpec
    dict
    len
    self._data.get_input_layer_fn
    d.keys
    self._head.create_estimator_spec
    super.__new__
    tensorflow.compat.v2.keras.losses.SparseCategoricalCrossentropy
    net.get_shape.max_output_size.min.max.tf.keras.layers.Dense
    node.input_selector
    Tower
    model_search.proto.phoenix_spec_pb2.PhoenixSpec
    random.sample
    model_search.metadata.trial.Trial
    self.get_completed_trials
    _one_nonzero_per_row.reshape
    tensorflow.compat.v1.keras.backend.conv1d
    tensorflow.compat.v2.estimator.RunConfig
    numpy.arange.tolist
    self._suggest_by_padding
    keras_tuner.HyperParameters.Int
    training_hooks.append
    re.compile.match
    self.Estimator.super.__init__
    tensorflow.compat.v2.estimator.EstimatorSpec
    self._get_good_architecture
    re.compile
    PolynomialFeatures.fit_transform
    weights.reshape
    tensorflow.compat.v2.compat.v1.estimator.tpu.TPUEstimatorSpec
    var_name.startswith
    tensorflow.compat.v2.cond
    output.append
    search_algorithm.get_suggestion
    model_search.architecture.architecture_utils.arg_scope
    model_search.generators.trial_utils.has_ensemble_search
    v.item
    model_search.hparam.HParams.from_proto.keys
    tf_slim.avg_pool2d
    make_run_config
    run_parameterized_train_and_eval
    self._phoenix_spec.ClearField
    _set_model_dir_for_run_config
    model_search.meta.distillation.get_distillation_loss_fn
    model_search.architecture.architecture_utils.get_architecture
    self._controller.get_generators.items
    model_search.metric_fns.make_auc_pr_metric_fn
    overrides.values.items.items
    optimizer_fn
    self.PriorGenerator.super._build_from_existing_checkpoint
    self._block_indices.index
    model_search.architecture.architecture_utils.get_architecture_size
    hook_fn
    traceback.extract_stack
    self.build_priors_intermixed
    time.sleep
    is_nonadaptive_ensemble_search
    model_search.block_builder.Blocks.search_space
    construct_tower
    Task
    tensorflow.compat.v2.nn.relu6
    _compute_paddings
    _merge_hparams.values
    EnsembleLogits
    node_list.append
    tf_slim.batch_norm
    ml_metadata.proto.metadata_store_pb2.ExecutionType
    numpy.any
    self._nonadaptive_ensemble
    k.startswith
    tensorflow.compat.v2.add_n
    keras_tuner.HyperParameters
    tensorflow.compat.v1.keras.backend.ones_like
    tensorflow.compat.v2.compat.v1.losses.mean_squared_error
    model_search.metadata.ml_metadata_db.MLMetaData
    self._data.number_of_classes
    model_search.architecture.architecture_utils.get_number_of_towers
    dataset.cache.prefetch.cache
    model_search.architecture.architecture_utils.strip_scope
    PARAM_RE.match.end
    input_tensor.get_shape.tf.keras.layers.Dense
    numpy.square
    self._metadata.report
    number_of_classes.tf.keras.layers.Dense
    model_search.architecture.architecture_utils.DirectoryHandler.get_trial_id
    tensorflow.compat.v2.keras.initializers.RandomUniform
    dtype_maps.append
    self._parse_variable_name
    self._make_model_fn
    tf_slim.conv2d
    self._hparam_types.get
    model_search.search.common.encode_architecture
    tensorflow.compat.v2.train.list_variables
    keras_tuner.HyperParameters.Float
    tensorflow.compat.v2.keras.layers.BatchNormalization
    tensorflow.compat.v2.io.gfile.listdir
    get_channel_dim
    self._predict_best_architecture
    get_dataset_provider.get_input_layer_fn
    self._strides.self._kernel_size.input_tensor.get_channel_dim.tf.keras.layers.Conv2D
    list
    _return_generators
    loss1_fn
    arg_scope
    tensorflow.compat.v2.group
    tensorflow.compat.v2.gather.set_shape
    self._add_filter_image_summary
    _parse_fail
    min
    self._get_best_trials
    self._activation.self._dilation_rate.self._kernel_size.self._output_size.tf.keras.layers.Conv1D
    tensorflow.compat.v2.io.gfile.exists
    aggregate_initial_architecture
    input_tensor.get_channel_dim.tf.keras.layers.Conv2D
    DistillationLogits
    tensorflow.compat.v2.compat.v1.train.NewCheckpointReader.get_tensor
    self.get_good_architecture
    os.path.basename.startswith
    _process_list_value
    self.activation
    self.add_weight
    _labels_are_one_hot
    as_text
    PARAM_RE.match.groupdict
    _build_nas_aux_head
    numpy.all
    tensorflow.compat.v2.concat
    model_search.hparam.HParams.del_hparam
    self._build_from_existing_checkpoint
    tensorflow.compat.v2.squeeze
    PolynomialFeatures.get_feature_names
    input_indices_list.append
    tensorflow.compat.v2.one_hot
    _TYPE_TAG.name.registry
    self._validation_filename.replace
    tensorflow.compat.v2.compat.v1.get_collection
    tensorflow.compat.v2.compat.v1.train.NewCheckpointReader
    original_hparams.values
    self._sort_previous_trial_variables.append
    model_search.hparam.HParams.from_proto.copy
    self.ResnetBlock.super.__init__
    numpy.sum
    complex
    model_search.hparam.startswith
    train_losses.extend
    functools.partial
    features_dataset.repeat.shuffle.map
    numpy.amin
    f.read
    architectures.reshape
    model_search.generators.trial_utils.adaptive_or_residual_ensemble.update
    model_search.loss_fns.make_multi_class_loss_fn
    dict.update
    numpy.savetxt
    tensorflow.compat.v2.compat.v1.train.SyncReplicasOptimizer.compute_gradients
    numpy.zeros_like
    TowerSpec
    tensorflow.compat.v2.keras.layers.LSTMCell
    absl.logging.error
    tensorflow.compat.v2.identity
    tensorflow.compat.v2.keras.layers.Flatten
    self._is_reduction_block
    store_hparams_to_dir
    Architecture
    padded_tensor_list.append
    tensorflow.compat.v2.keras.layers.SimpleRNNCell
    v.item.items
    model_search.generators.trial_utils.is_nonadaptive_ensemble_search
    tensorflow.compat.v2.compat.v1.losses.softmax_cross_entropy
    self.ConvolutionBlock.super.__init__
    create_new_architecture_fn
    keras_tuner.oracles.RandomSearchOracle
    model_search.architecture.architecture_utils.fix_architecture_order
    self.basis_function
    tensorflow.compat.v2.compat.v1.feature_column.input_layer
    hparams.values
    model_search.registry.lookup.requires_hparams
    sklearn.preprocessing.OneHotEncoder.inverse_transform
    tensorflow.compat.v2.io.gfile.GFile
    self._register
    outputs.get_shape
    registry.keys
    tensorflow.compat.v2.multiply
    self._extract_relevant_variables_indices
    var.name.startswith
    set.add
    HParams._get_kind_name.endswith
    is_training.feature_columns.tf.keras.layers.DenseFeatures
    callable
    self._replay_state.is_replay
    self.LowRankLayerBlock.super.__init__
    tensorflow.compat.v2.stop_gradient
    combiner_types_np.tolist.append
    tuple.append
    tensorflow.compat.v2.no_op
    

    @developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.

    opened by PyDeps 0
  • AttributeError: 'Tensor' object has no attribute 'numpy'

    AttributeError: 'Tensor' object has no attribute 'numpy'

    I've installed model search. And I'm testing the code in getting start but getting errors. I think successfully installed, but I don't know why this error occurs.

    1. Python Ver. = 3.7 or 3.8
    2. Packages listed in requirements.txt have been installed.
    3. The test code is as follows :

    import sys from absl import app

    sys.argv = sys.argv[:1]

    try: app.run(lambda argv: None) except: pass

    import model_search from model_search import constants from model_search import single_trainer from model_search.data import csv_data

    trainer = single_trainer.SingleTrainer( data=csv_data.Provider( label_index=0, logits_dimension=2, record_defaults=[0, 0, 0, 0], filename="model_search/data/testdata/csv_random_data.csv"), spec='model_search/configs/dnn_config.pbtxt')

    trainer.try_models( number_models=200, train_steps=1000, eval_steps=200, root_dir="/tmp/run_example", batch_size=32, experiment_name="example", experiment_owner="model_search_user")

    1. Errors are as follows : 2022-08-31 18:27:29.737977: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 21644 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:01:00.0, compute capability: 8.6 I0831 18:27:29.751516 140527906674496 saver.py:1395] Restoring parameters from /tmp/run_example/tuner-1/23/model.ckpt-1000 I0831 18:27:29.763098 140527906674496 builder_impl.py:669] Assets added to graph. I0831 18:27:29.763194 140527906674496 builder_impl.py:463] No assets to write. I0831 18:27:29.783092 140527906674496 builder_impl.py:428] SavedModel written to: /tmp/run_example/tuner-1/23/saved_model/temp-1661938049/saved_model.pb I0831 18:27:29.784265 140527906674496 oss_trainer_lib.py:278] Evaluation results: {'accuracy': 0.7, 'auc_pr': 1.0, 'auc_roc': 0.9999998, 'loss': 0.54577476, 'num_parameters': 9236, 'global_step': 1000} I0831 18:27:29.786289 140527906674496 oss_trainer_lib.py:303] creating directory: /tmp/run_example/tuner-1/24 I0831 18:27:29.786396 140527906674496 oss_trainer_lib.py:350] Tuner id: tuner-1 I0831 18:27:29.786435 140527906674496 oss_trainer_lib.py:351] Training with the following hyperparameters: I0831 18:27:29.786465 140527906674496 oss_trainer_lib.py:352] {'learning_rate': 5.270349994604263e-06, 'new_block_type': 'FULLY_CONNECTED_RESIDUAL_PROJECT_BATCHNORM', 'optimizer': 'sgd', 'initial_architecture_0': 'FULLY_CONNECTED_RESIDUAL_PROJECT', 'exponential_decay_rate': 0.9005046125313068, 'exponential_decay_steps': 1000, 'gradient_max_norm': 2, 'dropout_rate': 0.20000000596046447, 'initial_architecture': ['FULLY_CONNECTED_RESIDUAL_PROJECT']} I0831 18:27:29.786560 140527906674496 run_config.py:549] TF_CONFIG environment variable: {'model_dir': '/tmp/run_example/tuner-1/24', 'session_master': ''} I0831 18:27:29.786598 140527906674496 run_config.py:985] Using model_dir in TF_CONFIG: /tmp/run_example/tuner-1/24 I0831 18:27:29.786791 140527906674496 estimator.py:202] Using config: {'_model_dir': '/tmp/run_example/tuner-1/24', '_tf_random_seed': None, '_save_summary_steps': 2000, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 120, '_session_config': allow_soft_placement: true graph_options { rewrite_options { meta_optimizer_iterations: ONE } } , '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': 100, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_experimental_max_worker_delay_secs': None, '_session_creation_timeout_secs': 7200, '_checkpoint_save_graph_def': True, '_service': None, '_cluster_spec': ClusterSpec({}), '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1} I0831 18:27:29.803411 140527906674496 estimator.py:1173] Calling model_fn. I0831 18:27:29.803532 140527906674496 phoenix.py:355] <tensorflow_estimator.python.estimator.run_config.RunConfig object at 0x7fce0074fdf0> I0831 18:27:29.803575 140527906674496 phoenix.py:356] /tmp/run_example/tuner-1/24 I0831 18:27:29.823276 140527906674496 controller.py:160] trial id: 24 I0831 18:27:29.823375 140527906674496 controller.py:239] intermix ensemble search mode I0831 18:27:29.827098 140527906674496 phoenix.py:387] {'search_generator': GeneratorWithTrials(instance=<model_search.generators.search_candidate_generator.SearchCandidateGenerator object at 0x7fce26aa6280>, relevant_trials=[<model_search.metadata.trial.Trial object at 0x7fce1c78baf0>, <model_search.metadata.trial.Trial object at 0x7fce1c78bbe0>, <model_search.metadata.trial.Trial object at 0x7fce0075c5b0>, <model_search.metadata.trial.Trial object at 0x7fce1c7a6b20>, <model_search.metadata.trial.Trial object at 0x7fce1c7956a0>, <model_search.metadata.trial.Trial object at 0x7fce1c795df0>, <model_search.metadata.trial.Trial object at 0x7fce1c797850>, <model_search.metadata.trial.Trial object at 0x7fce1c797c40>, <model_search.metadata.trial.Trial object at 0x7fce1c793c40>, <model_search.metadata.trial.Trial object at 0x7fce1c794850>, <model_search.metadata.trial.Trial object at 0x7fce1c794c40>, <model_search.metadata.trial.Trial object at 0x7fce24371850>, <model_search.metadata.trial.Trial object at 0x7fce24359850>, <model_search.metadata.trial.Trial object at 0x7fce24359c40>, <model_search.metadata.trial.Trial object at 0x7fce24372850>, <model_search.metadata.trial.Trial object at 0x7fce24372c40>, <model_search.metadata.trial.Trial object at 0x7fce2434ac40>, <model_search.metadata.trial.Trial object at 0x7fce24337850>, <model_search.metadata.trial.Trial object at 0x7fce24337c40>])} I0831 18:27:29.827618 140527906674496 coordinate_descent.py:63] Maximal depth allowed: 4 I0831 18:27:29.827801 140527906674496 search_candidate_generator.py:123] Creating new architecture: I0831 18:27:29.827841 140527906674496 search_candidate_generator.py:124] [82 81] I0831 18:27:29.830933 140527906674496 phoenix.py:406] {'search_generator': [<model_search.architecture.tower.Tower object at 0x7fce24351d90>]} I0831 18:27:30.007734 140527906674496 run_config.py:549] TF_CONFIG environment variable: {'model_dir': '/tmp/run_example/tuner-1/24', 'session_master': ''} I0831 18:27:30.007827 140527906674496 run_config.py:985] Using model_dir in TF_CONFIG: /tmp/run_example/tuner-1/24 I0831 18:27:30.243517 140527906674496 estimator.py:1175] Done calling model_fn. I0831 18:27:30.244107 140527906674496 basic_session_run_hooks.py:558] Create CheckpointSaverHook. I0831 18:27:30.344659 140527906674496 monitored_session.py:243] Graph was finalized. 2022-08-31 18:27:30.344949: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:30.345194: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:30.345355: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:30.345549: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:30.345726: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:30.345873: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 21644 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:01:00.0, compute capability: 8.6 I0831 18:27:30.390913 140527906674496 session_manager.py:527] Running local_init_op. I0831 18:27:30.404366 140527906674496 session_manager.py:530] Done running local_init_op. I0831 18:27:30.648690 140527906674496 basic_session_run_hooks.py:628] Calling checkpoint listeners before saving checkpoint 0... I0831 18:27:30.649056 140527906674496 basic_session_run_hooks.py:633] Saving checkpoints for 0 into /tmp/run_example/tuner-1/24/model.ckpt. I0831 18:27:30.703323 140527906674496 basic_session_run_hooks.py:640] Calling checkpoint listeners after saving checkpoint 0... I0831 18:27:31.163495 140527906674496 basic_session_run_hooks.py:266] loss = 1.035786, step = 0 I0831 18:27:31.420209 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 388.237 I0831 18:27:31.420408 140527906674496 basic_session_run_hooks.py:264] loss = 0.9075287, step = 100 (0.257 sec) I0831 18:27:31.558015 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 725.577 I0831 18:27:31.558200 140527906674496 basic_session_run_hooks.py:264] loss = 1.0140789, step = 200 (0.138 sec) I0831 18:27:31.690464 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 755.011 I0831 18:27:31.690645 140527906674496 basic_session_run_hooks.py:264] loss = 1.0821533, step = 300 (0.132 sec) I0831 18:27:31.824359 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 746.852 I0831 18:27:31.824541 140527906674496 basic_session_run_hooks.py:264] loss = 1.1923344, step = 400 (0.134 sec) I0831 18:27:31.954357 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 769.251 I0831 18:27:31.954540 140527906674496 basic_session_run_hooks.py:264] loss = 1.2966073, step = 500 (0.130 sec) I0831 18:27:32.083554 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 773.977 I0831 18:27:32.083731 140527906674496 basic_session_run_hooks.py:264] loss = 1.0678508, step = 600 (0.129 sec) I0831 18:27:32.211544 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 781.295 I0831 18:27:32.211720 140527906674496 basic_session_run_hooks.py:264] loss = 1.1640563, step = 700 (0.128 sec) I0831 18:27:32.342442 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 763.951 I0831 18:27:32.342617 140527906674496 basic_session_run_hooks.py:264] loss = 1.2269, step = 800 (0.131 sec) I0831 18:27:32.476507 140527906674496 basic_session_run_hooks.py:717] global_step/sec: 745.914 I0831 18:27:32.476685 140527906674496 basic_session_run_hooks.py:264] loss = 1.2129242, step = 900 (0.134 sec) I0831 18:27:32.605798 140527906674496 basic_session_run_hooks.py:628] Calling checkpoint listeners before saving checkpoint 1000... I0831 18:27:32.605903 140527906674496 basic_session_run_hooks.py:633] Saving checkpoints for 1000 into /tmp/run_example/tuner-1/24/model.ckpt. I0831 18:27:32.649677 140527906674496 basic_session_run_hooks.py:640] Calling checkpoint listeners after saving checkpoint 1000... I0831 18:27:32.660749 140527906674496 estimator.py:361] Loss for final step: 1.1485888. I0831 18:27:32.678622 140527906674496 estimator.py:1173] Calling model_fn. I0831 18:27:32.678768 140527906674496 phoenix.py:355] <tensorflow_estimator.python.estimator.run_config.RunConfig object at 0x7fce0074fdf0> I0831 18:27:32.678819 140527906674496 phoenix.py:356] /tmp/run_example/tuner-1/24 I0831 18:27:32.699427 140527906674496 controller.py:160] trial id: 24 I0831 18:27:32.699542 140527906674496 controller.py:239] intermix ensemble search mode I0831 18:27:32.704100 140527906674496 phoenix.py:387] {'search_generator': GeneratorWithTrials(instance=<model_search.generators.search_candidate_generator.SearchCandidateGenerator object at 0x7fce26aa6280>, relevant_trials=[<model_search.metadata.trial.Trial object at 0x7fce242128e0>, <model_search.metadata.trial.Trial object at 0x7fce24212490>, <model_search.metadata.trial.Trial object at 0x7fce24348b80>, <model_search.metadata.trial.Trial object at 0x7fce1c7a7820>, <model_search.metadata.trial.Trial object at 0x7fce1c27c220>, <model_search.metadata.trial.Trial object at 0x7fce25e36b20>, <model_search.metadata.trial.Trial object at 0x7fce25e361c0>, <model_search.metadata.trial.Trial object at 0x7fce240dff70>, <model_search.metadata.trial.Trial object at 0x7fce25dbe3d0>, <model_search.metadata.trial.Trial object at 0x7fce25fe2e20>, <model_search.metadata.trial.Trial object at 0x7fce240e4160>, <model_search.metadata.trial.Trial object at 0x7fce25fe2580>, <model_search.metadata.trial.Trial object at 0x7fce1c36ea60>, <model_search.metadata.trial.Trial object at 0x7fce1c0fed60>, <model_search.metadata.trial.Trial object at 0x7fce1c36ee80>, <model_search.metadata.trial.Trial object at 0x7fce1c0feeb0>, <model_search.metadata.trial.Trial object at 0x7fce25f3f5b0>, <model_search.metadata.trial.Trial object at 0x7fce25f3f3d0>, <model_search.metadata.trial.Trial object at 0x7fce2422fac0>])} I0831 18:27:32.704649 140527906674496 base_tower_generator.py:99] Building from existing checkpoint. I0831 18:27:32.711285 140527906674496 phoenix.py:406] {'search_generator': [<model_search.architecture.tower.Tower object at 0x7fce24212a90>]} I0831 18:27:32.773150 140527906674496 run_config.py:549] TF_CONFIG environment variable: {'model_dir': '/tmp/run_example/tuner-1/24', 'session_master': ''} I0831 18:27:32.773260 140527906674496 run_config.py:985] Using model_dir in TF_CONFIG: /tmp/run_example/tuner-1/24 I0831 18:27:32.929626 140527906674496 estimator.py:1175] Done calling model_fn. I0831 18:27:32.940950 140527906674496 evaluation.py:250] Starting evaluation at 2022-08-31T18:27:32 I0831 18:27:32.983377 140527906674496 monitored_session.py:243] Graph was finalized. 2022-08-31 18:27:32.983673: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:32.983907: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:32.984069: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:32.984265: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:32.984439: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:32.984585: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 21644 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:01:00.0, compute capability: 8.6 I0831 18:27:32.984675 140527906674496 saver.py:1395] Restoring parameters from /tmp/run_example/tuner-1/24/model.ckpt-1000 I0831 18:27:33.023914 140527906674496 session_manager.py:527] Running local_init_op. I0831 18:27:33.039376 140527906674496 session_manager.py:530] Done running local_init_op. I0831 18:27:33.158018 140527906674496 evaluation.py:269] Inference Time : 0.21697s I0831 18:27:33.159124 140527906674496 evaluation.py:271] Finished evaluation at 2022-08-31-18:27:33 I0831 18:27:33.159208 140527906674496 estimator.py:2083] Saving dict for global step 1000: accuracy = 0.3, auc_pr = 0.48401165, auc_roc = 7.142855e-08, global_step = 1000, loss = 0.97662735, num_parameters = 86 I0831 18:27:33.209768 140527906674496 estimator.py:2143] Saving 'checkpoint_path' summary for global step 1000: /tmp/run_example/tuner-1/24/model.ckpt-1000 I0831 18:27:33.210166 140527906674496 phoenix.py:136] Saving the following evaluation dictionary. I0831 18:27:33.210225 140527906674496 phoenix.py:137] {'accuracy': 0.30000001192092896, 'auc_pr': 0.4840116500854492, 'auc_roc': 7.142855196207165e-08, 'loss': 0.9766273498535156, 'num_parameters': 86, 'global_step': 1000} I0831 18:27:33.210270 140527906674496 ml_metadata_db.py:161] Storing the following evaluation dictionary, I0831 18:27:33.210300 140527906674496 ml_metadata_db.py:162] {'accuracy': 0.30000001192092896, 'auc_pr': 0.4840116500854492, 'auc_roc': 7.142855196207165e-08, 'loss': 0.9766273498535156, 'num_parameters': 86, 'global_step': 1000} I0831 18:27:33.210334 140527906674496 ml_metadata_db.py:163] For the model in the following model dictionary, I0831 18:27:33.210361 140527906674496 ml_metadata_db.py:164] /tmp/run_example/tuner-1/24 I0831 18:27:33.238589 140527906674496 estimator.py:1173] Calling model_fn. I0831 18:27:33.238721 140527906674496 phoenix.py:355] <tensorflow_estimator.python.estimator.run_config.RunConfig object at 0x7fce0074fdf0> I0831 18:27:33.238767 140527906674496 phoenix.py:356] /tmp/run_example/tuner-1/24 I0831 18:27:33.259187 140527906674496 controller.py:160] trial id: 24 I0831 18:27:33.259282 140527906674496 controller.py:239] intermix ensemble search mode I0831 18:27:33.262947 140527906674496 phoenix.py:387] {'search_generator': GeneratorWithTrials(instance=<model_search.generators.search_candidate_generator.SearchCandidateGenerator object at 0x7fce26aa6280>, relevant_trials=[<model_search.metadata.trial.Trial object at 0x7fce25dbcd90>, <model_search.metadata.trial.Trial object at 0x7fce1c46ff40>, <model_search.metadata.trial.Trial object at 0x7fce25dbcbe0>, <model_search.metadata.trial.Trial object at 0x7fce25dbce50>, <model_search.metadata.trial.Trial object at 0x7fce1c46f8b0>, <model_search.metadata.trial.Trial object at 0x7fce1c44cf70>, <model_search.metadata.trial.Trial object at 0x7fce1c44c160>, <model_search.metadata.trial.Trial object at 0x7fce1c29ffd0>, <model_search.metadata.trial.Trial object at 0x7fce25f033d0>, <model_search.metadata.trial.Trial object at 0x7fce1c29ff10>, <model_search.metadata.trial.Trial object at 0x7fce25f3cb80>, <model_search.metadata.trial.Trial object at 0x7fce25f14cd0>, <model_search.metadata.trial.Trial object at 0x7fce00730bb0>, <model_search.metadata.trial.Trial object at 0x7fce1c10fd60>, <model_search.metadata.trial.Trial object at 0x7fce00730b20>, <model_search.metadata.trial.Trial object at 0x7fce00730d00>, <model_search.metadata.trial.Trial object at 0x7fce1c6599d0>, <model_search.metadata.trial.Trial object at 0x7fce1c659580>, <model_search.metadata.trial.Trial object at 0x7fce1c45a9a0>, <model_search.metadata.trial.Trial object at 0x7fce25e47550>])} I0831 18:27:33.263211 140527906674496 base_tower_generator.py:99] Building from existing checkpoint. I0831 18:27:33.267359 140527906674496 phoenix.py:406] {'search_generator': [<model_search.architecture.tower.Tower object at 0x7fce1c3d53a0>]} I0831 18:27:33.322653 140527906674496 run_config.py:549] TF_CONFIG environment variable: {'model_dir': '/tmp/run_example/tuner-1/24', 'session_master': ''} I0831 18:27:33.322746 140527906674496 run_config.py:985] Using model_dir in TF_CONFIG: /tmp/run_example/tuner-1/24 I0831 18:27:33.324692 140527906674496 estimator.py:1175] Done calling model_fn. I0831 18:27:33.324922 140527906674496 export_utils.py:166] Signatures INCLUDED in export for Classify: None I0831 18:27:33.324964 140527906674496 export_utils.py:166] Signatures INCLUDED in export for Regress: None I0831 18:27:33.324995 140527906674496 export_utils.py:166] Signatures INCLUDED in export for Predict: ['serving_default'] I0831 18:27:33.325023 140527906674496 export_utils.py:166] Signatures INCLUDED in export for Train: None I0831 18:27:33.325047 140527906674496 export_utils.py:166] Signatures INCLUDED in export for Eval: None 2022-08-31 18:27:33.325256: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:33.325487: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:33.325648: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:33.325842: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:33.326005: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:936] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2022-08-31 18:27:33.326149: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1525] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 21644 MB memory: -> device: 0, name: NVIDIA GeForce RTX 3090, pci bus id: 0000:01:00.0, compute capability: 8.6 I0831 18:27:33.340039 140527906674496 saver.py:1395] Restoring parameters from /tmp/run_example/tuner-1/24/model.ckpt-1000 I0831 18:27:33.352076 140527906674496 builder_impl.py:669] Assets added to graph. I0831 18:27:33.352158 140527906674496 builder_impl.py:463] No assets to write. I0831 18:27:33.372737 140527906674496 builder_impl.py:428] SavedModel written to: /tmp/run_example/tuner-1/24/saved_model/temp-1661938053/saved_model.pb I0831 18:27:33.373998 140527906674496 oss_trainer_lib.py:278] Evaluation results: {'accuracy': 0.3, 'auc_pr': 0.48401165, 'auc_roc': 7.142855e-08, 'loss': 0.97662735, 'num_parameters': 86, 'global_step': 1000} Traceback (most recent call last): File "test.py", line 26, in trainer.try_models( File "/mnt/hdd1/model_search_220825/model_search/model_search/single_trainer.py", line 78, in try_models while oss_trainer_lib.run_parameterized_train_and_eval( File "/mnt/hdd1/model_search_220825/model_search/model_search/oss_trainer_lib.py", line 340, in run_parameterized_train_and_eval trial = oracle.create_trial(tuner_id) File "/home/nagakura/anaconda3.8.8_pytorch/envs/model_search_220825/lib/python3.8/site-packages/keras_tuner/engine/oracle.py", line 189, in create_trial response = self.populate_space(trial_id) File "/home/nagakura/anaconda3.8.8_pytorch/envs/model_search_220825/lib/python3.8/site-packages/keras_tuner/tuners/bayesian.py", line 209, in populate_space self.gpr.fit(x, y) File "/home/nagakura/anaconda3.8.8_pytorch/envs/model_search_220825/lib/python3.8/site-packages/keras_tuner/tuners/bayesian.py", line 83, in fit self._alpha_vector = cho_solve(self._l_matrix, self._y_train) File "/home/nagakura/anaconda3.8.8_pytorch/envs/model_search_220825/lib/python3.8/site-packages/keras_tuner/tuners/bayesian.py", line 31, in cho_solve y = solve_triangular(l_matrix, b.reshape(-1, 1), lower=True) File "/home/nagakura/anaconda3.8.8_pytorch/envs/model_search_220825/lib/python3.8/site-packages/keras_tuner/tuners/bayesian.py", line 24, in solve_triangular return tf.linalg.triangular_solve(a, b, lower=lower).numpy() File "/home/nagakura/anaconda3.8.8_pytorch/envs/model_search_220825/lib/python3.8/site-packages/tensorflow/python/framework/ops.py", line 513, in getattr self.getattribute(name) AttributeError: 'Tensor' object has no attribute 'numpy'

    2. Note Getting Started has number_models=200, but the result is the same. If I set number_models to less than 20, the error does not occur. is there a limit of 20 for number_models?

    opened by makonaga 0
  • sqlite default filename is not Windows compatible

    sqlite default filename is not Windows compatible

    File model_search/metadata/ml_metadata_db.py, lines 102-103 are:

            self._connection_config.sqlite.filename_uri = (
                "/tmp/filedb-%d" % random.randint(0, 1000000))
    

    /tmp/... is of course not a valid path for Windows. Can you update this path such that it chooses a valid path when running on Windows?

    opened by DeanIsMe 0
  • How to know which model is the best and what is its accuracy?

    How to know which model is the best and what is its accuracy?

    I have trained 200 models using trainer.try_models() but now I need to know which model performed the best and its accuracy?

    Anyone knows how to get the details such as: what evaluation score was used? what is the best model? and how can we use it later for prediction?

    Thank you.

    opened by meriemferdjouni 4
  • How to predict from model_search saved_model.pb

    How to predict from model_search saved_model.pb

    Hi, I have tried simple classification dataset "German credit data" to make predictions. I load the model_search saved_model.pb model. importedModel = tf.saved_model.load(saved_model_dir)

    But, when I try to predict or make summary() from the model ,I get the following error,

    AttributeError: 'AutoTrackable' object has no attribute 'summary'

    When I print print (gs_model.signatures), I got "['serving_default']".

    How can I predict, get metrics like f1_score, accuracy, R2,etc from the model.

    Is it possible to store the model_search model as tenorflow v2 compatible in oss_trainer_lib.py instead of "estimator"model.

    Pls suggest on this. I am using tensorflow 2.4.0 How can I make the model to work like keras model.

    Thanks, SJRam

    opened by jayarams79 3
Owner
Google
Google ❤️ Open Source
Google
code for paper "Does Unsupervised Architecture Representation Learning Help Neural Architecture Search?"

Does Unsupervised Architecture Representation Learning Help Neural Architecture Search? Code for paper: Does Unsupervised Architecture Representation

null 39 Dec 17, 2022
MMRazor: a model compression toolkit for model slimming and AutoML

Documentation: https://mmrazor.readthedocs.io/ English | 简体中文 Introduction MMRazor is a model compression toolkit for model slimming and AutoML, which

OpenMMLab 899 Jan 2, 2023
Implements MLP-Mixer: An all-MLP Architecture for Vision.

MLP-Mixer-CIFAR10 This repository implements MLP-Mixer as proposed in MLP-Mixer: An all-MLP Architecture for Vision. The paper introduces an all MLP (

Sayak Paul 51 Jan 4, 2023
Code release to accompany paper "Geometry-Aware Gradient Algorithms for Neural Architecture Search."

Geometry-Aware Gradient Algorithms for Neural Architecture Search This repository contains the code required to run the experiments for the DARTS sear

null 18 May 27, 2022
This implements one of result networks from Large-scale evolution of image classifiers

Exotic structured image classifier This implements one of result networks from Large-scale evolution of image classifiers by Esteban Real, et. al. Req

null 54 Nov 25, 2022
FastReID is a research platform that implements state-of-the-art re-identification algorithms.

FastReID is a research platform that implements state-of-the-art re-identification algorithms.

JDAI-CV 2.8k Jan 7, 2023
deep-table implements various state-of-the-art deep learning and self-supervised learning algorithms for tabular data using PyTorch.

deep-table implements various state-of-the-art deep learning and self-supervised learning algorithms for tabular data using PyTorch.

null 63 Oct 17, 2022
Densely Connected Search Space for More Flexible Neural Architecture Search (CVPR2020)

DenseNAS The code of the CVPR2020 paper Densely Connected Search Space for More Flexible Neural Architecture Search. Neural architecture search (NAS)

Jamin Fong 291 Nov 18, 2022
Clairvoyance: a Unified, End-to-End AutoML Pipeline for Medical Time Series

Clairvoyance: A Pipeline Toolkit for Medical Time Series Authors: van der Schaar Lab This repository contains implementations of Clairvoyance: A Pipel

van_der_Schaar \LAB 89 Dec 7, 2022
An AutoML Library made with Optuna and PyTorch Lightning

An AutoML Library made with Optuna and PyTorch Lightning Installation Recommended pip install -U gradsflow From source pip install git+https://github.

GradsFlow 294 Dec 17, 2022
Neural networks applied in recognizing guitar chords using python, AutoML.NET with C# and .NET Core

Chord Recognition Demo application The demo application is written in C# with .NETCore. As of July 9, 2020, the only version available is for windows

Andres Mauricio Rondon Patiño 24 Oct 22, 2022
AutoDeeplab / auto-deeplab / AutoML for semantic segmentation, implemented in Pytorch

AutoML for Image Semantic Segmentation Currently this repo contains the only working open-source implementation of Auto-Deeplab which, by the way out-

AI Necromancer 299 Dec 17, 2022
(ImageNet pretrained models) The official pytorch implemention of the TPAMI paper "Res2Net: A New Multi-scale Backbone Architecture"

Res2Net The official pytorch implemention of the paper "Res2Net: A New Multi-scale Backbone Architecture" Our paper is accepted by IEEE Transactions o

Res2Net Applications 928 Dec 29, 2022
Compute descriptors for 3D point cloud registration using a multi scale sparse voxel architecture

MS-SVConv : 3D Point Cloud Registration with Multi-Scale Architecture and Self-supervised Fine-tuning Compute features for 3D point cloud registration

null 42 Jul 25, 2022
This framework implements the data poisoning method found in the paper Adversarial Examples Make Strong Poisons

Adversarial poison generation and evaluation. This framework implements the data poisoning method found in the paper Adversarial Examples Make Strong

null 31 Nov 1, 2022
Reinforcement learning library(framework) designed for PyTorch, implements DQN, DDPG, A2C, PPO, SAC, MADDPG, A3C, APEX, IMPALA ...

Automatic, Readable, Reusable, Extendable Machin is a reinforcement library designed for pytorch. Build status Platform Status Linux Windows Supported

Iffi 348 Dec 24, 2022
This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of Coordinate Independent Convolutional Networks.

Orientation independent Möbius CNNs This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of

Maurice Weiler 59 Dec 9, 2022
SLIDE : In Defense of Smart Algorithms over Hardware Acceleration for Large-Scale Deep Learning Systems

The SLIDE package contains the source code for reproducing the main experiments in this paper. Dataset The Datasets can be downloaded in Amazon-

Intel Labs 72 Dec 16, 2022