Code Monkey home page Code Monkey logo

Comments (4)

AndrewDotson avatar AndrewDotson commented on June 20, 2024

I also seem to be to having this issue. I'm trying to run a slightly modified version of the BasicWorkflow.py. My file dies on the line "syncer_obj.sync_model("train", model_config1, mdb_model1)" with the same error as reported above.

Everything else works just fine; I'm able to sync and view the model.

I'm running ModelDB on an Ubuntu 16 VM. I have attached the file I'm trying to run below.

from modeldb.basic.Structs import (
    Model, ModelConfig, ModelMetrics, Dataset)
from modeldb.basic.ModelDbSyncerBase import *
import pyspark

# Create a syncer using a convenience API
# syncer_obj = Syncer.create_syncer("gensim test", "test_user", \
#     "using modeldb light logging")

# Example: Create a syncer from a config file
syncer_obj = Syncer.create_syncer_from_config("/home/testuser/modeldb/client/syncer.json")

# Create a syncer using a convenience API
#syncer_obj = Syncer.create_syncer("Sample Project", "test_user", "sample description")
# or
# Create a syncer explicitly
#syncer_obj = Syncer(
#    NewOrExistingProject("PySpark_test", "Andrew", "pyspark test using modeldb light logging"),
#    DefaultExperiment(),
#    NewExperimentRun("", "sha_A1B2C3D4"))

# Example: Create a syncer from an existing experiment run
# experiment_run_id = int(sys.argv[len(sys.argv) - 1])
# syncer_obj = Syncer.create_syncer_for_experiment_run(experiment_run_id)

print "I'm training some model"

# create Datasets by specifying their filepaths and optional metadata
# associate a tag (key) for each Dataset (value)
datasets = {
    "train": Dataset("/home/testuser/modeldb/data/titanic_train.csv", {"num_cols": 12,}),
    "test": Dataset("/home/testuser/modeldb/data/titanic_test.csv", {"num_cols": 12,})
}

# create the Model, ModelConfig, and ModelMetrics instances
model = "model_obj"
mdb_model1 = Model("LogReg", model, "client/python/samples/sklearn/Titanic-LogisticRegression.py")
model_config1 = ModelConfig("NN", {"l1": 10})
model_metrics1 = ModelMetrics({"accuracy": 0.8})

#mdb_model2 = Model("NN", model, "/path/to/model2")
#model_config2 = ModelConfig("NN", {"l1": 20})
#model_metrics2 = ModelMetrics({"accuracy": 0.9})

syncer_obj.sync_datasets(datasets)

syncer_obj.sync_model("train", model_config1, mdb_model1)
syncer_obj.sync_metrics("test", mdb_model1, model_metrics1)

#syncer_obj.sync_model("train", model_config2, mdb_model2)
#syncer_obj.sync_metrics("test", mdb_model2, model_metrics2)

syncer_obj.sync()

from modeldb.

AndrewDotson avatar AndrewDotson commented on June 20, 2024

I was able to fix this problem by modifying the 'sync_model' and 'sync_metrics' methods in /usr/local/lib/python2.7/dist-packages/modeldb/basic/ModelDbSyncerBase.py. I changed Syncer.instance.add_to_buffer() to self.add_to_buffer() and the script ran.

I don't know what other issues this fix may cause, but so far I've not noticed any.

from modeldb.

justinanderson avatar justinanderson commented on June 20, 2024

It looks like this is a problem with the pip distribution of modeldb. If you build from source it works without modification.

I'll see about updating the PyPi distribution.

from modeldb.

justinanderson avatar justinanderson commented on June 20, 2024

Resolved by updating the PyPi distribution. New version is 0.0.1a29.

from modeldb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.