Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Hyper-parameter page broken #1332

Closed
ultmaster opened this issue Jul 18, 2019 · 1 comment
Closed

Hyper-parameter page broken #1332

ultmaster opened this issue Jul 18, 2019 · 1 comment
Labels
bug Something isn't working nnidev

Comments

@ultmaster
Copy link
Contributor

Short summary about the issue/question:

I'm trying to use NNI to train my network, and what the first few trials show "SUCCEEDED", I can no longer visit the hyper-parameter page in training details.

Then I press F12 to see what's going on. It seems like some "undefined" bug.

DOMException: Failed to execute 'addColorStop' on 'CanvasGradient': The value provided ('undefined') could not be parsed as a color.
    at o.getGradient (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:852514)
    at t.brush (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:86745)
    at g._doPaintEl (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2283310)
    at g._doPaintList (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2282292)
    at g._paintList (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2281297)
    at g.refresh (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2280095)
    at p.refreshImmediately (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:451438)
    at p.flush (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:451567)
    at W.B.setOption (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:8912)
    at t.n.renderEchartDom (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2707289)
ha @ react-dom.production.min.js:198
n.callback @ react-dom.production.min.js:210
ia @ react-dom.production.min.js:193
na @ react-dom.production.min.js:193
ja @ react-dom.production.min.js:217
Ba @ react-dom.production.min.js:220
(anonymous) @ react-dom.production.min.js:250
t.unstable_runWithPriority @ scheduler.production.min.js:18
Is @ react-dom.production.min.js:250
Ts @ react-dom.production.min.js:249
Os @ react-dom.production.min.js:248
Ds @ react-dom.production.min.js:251
On @ react-dom.production.min.js:85
react-dom.production.min.js:248 Uncaught DOMException: Failed to execute 'addColorStop' on 'CanvasGradient': The value provided ('undefined') could not be parsed as a color.
    at o.getGradient (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:852514)
    at t.brush (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:86745)
    at g._doPaintEl (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2283310)
    at g._doPaintList (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2282292)
    at g._paintList (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2281297)
    at g.refresh (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2280095)
    at p.refreshImmediately (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:451438)
    at p.flush (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:451567)
    at W.B.setOption (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:8912)
    at t.n.renderEchartDom (http://10.150.144.124:20718/static/js/main.565fbd70.js:1:2707289)

Brief what process you are following:

How to reproduce it:

My tuner is as follows:

from nni.gridsearch_tuner.gridsearch_tuner import GridSearchTuner


class FixedProductTuner(GridSearchTuner):

    def __init__(self, product):
        super().__init__()
        self.product = product

    def expand_parameters(self, para):
        para = super().expand_parameters(para)
        if all([key in para[0] for key in ["alpha", "beta", "gamma"]]):
            ret_para = []
            for p in para:
                prod = p["alpha"] * (p["beta"] ** 2) * (p["gamma"] ** 2)
                if abs(prod - self.product) < 0.05:
                    ret_para.append(p)
            return ret_para
        return para
import tensorflow as tf


class NNIExporter(tf.estimator.Exporter):
    def export(self, estimator, export_path, checkpoint_path, eval_result,
               is_the_final_export):
        import nni
        result = eval_result["top_1_accuracy"]
        if is_the_final_export:
            nni.report_intermediate_result(result)
        else:
            nni.report_intermediate_result(result)

    @property
    def name(self):
        return "nni_exporter"

Here is my config file and search space:

authorName: xxx
experimentName: example_efficient_net
trialConcurrency: 4
maxExecDuration: 1h
maxTrialNum: 20
trainingServicePlatform: local
searchSpacePath: search.json
useAnnotation: false
tuner:
  codeDir: .
  classFileName: tuner.py
  className: FixedProductTuner
  classArgs:
    product: 2
trial:
  codeDir: .
  command: python trainer.py --batch-size 24 --request-from-nni
  gpuNum: 1
{
  "alpha": {
    "_type": "quniform",
    "_value": [1.0, 2.0, 10]
  },
  "beta": {
    "_type": "quniform",
    "_value": [1.0, 1.5, 10]
  },
  "gamma": {
    "_type": "quniform",
    "_value": [1.0, 1.5, 10]
  }
}

nni Environment:

  • nni version: 0.9.1.1
  • nni mode(local|pai|remote): local
  • OS: ubuntu 16.04
  • python version: python 3.6
  • is conda or virtualenv used?: conda
  • is running in docker?: no

need to update document(yes/no): no

Anything else we need to know:

@ultmaster
Copy link
Contributor Author

I did some digging and figured that I didn't sent FINAL result (all results are INTERMEDIATE). Could that be the cause?

BTW, don't you think it's more reasonable to make the last result automatically FINAL, in case the user forgets to send one?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working nnidev
Projects
None yet
Development

No branches or pull requests

5 participants