itayhubara / BinaryNet.tf

BNN implementation in tensorflow
165 stars 54 forks source link

No module named models.BNN_cifar10 #12

Open xiaoyang666 opened 5 years ago

xiaoyang666 commented 5 years ago

I find the good way to solve ts problem. Thank you

MaxwellWjj commented 5 years ago

I find the good way to solve ts problem. Thank you

Hello, Can you please tell me how to solve this problem? I found that the error seems to occur in main.py: if not gfile.Exists(FLAGS.checkpoint_dir):

gfile.DeleteRecursively(FLAGS.checkpoint_dir)

    gfile.MakeDirs(FLAGS.checkpoint_dir)
    model_file = os.path.join('models', FLAGS.model + '.py')
    assert gfile.Exists(model_file), 'no model file named: ' + model_file
    gfile.Copy(model_file, FLAGS.checkpoint_dir + '/model.py') 

(IDE: Spyder)

mehreenjabeen commented 5 years ago

got below error upon executing "python main.py --model BNN_cifar10 --save BNN_cifar10 --dataset cifar10 --gpu True" Traceback (most recent call last): File "main.py", line 240, in tf.app.run() File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 125, in run _sys.exit(main(argv)) File "main.py", line 229, in main m = importlib.import_module('.' +FLAGS.model, 'models') File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: No module named models.BNN_cifar10

mehreenjabeen commented 5 years ago

I find the good way to solve ts problem. Thank you

can u plz explain how

mengwanguc commented 5 years ago

I find the good way to solve ts problem. Thank you

can u plz explain how

I solved it by adding "__init.py" in models. You can google "__init.py" for more details. Hope it helps.