Giter Club home page Giter Club logo

tensorflowframework's People

Contributors

vahidk avatar ychfan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorflowframework's Issues

RuntimeError: main thread is not in main loop

I met a problem when I run your code, can you solve it?

WARNING:tensorflow:uid (from tensorflow.contrib.learn.python.learn.estimators.run_config) is experimental and may change or be removed at any time, and without warning.
INFO:tensorflow:Using config: {'_model_dir': 'output/cnn_classifier_mnist', '_save_checkpoints_secs': None, '_num_ps_replicas': 0, '_keep_checkpoint_max': 5, '_session_config': gpu_options {
allow_growth: true
}
allow_soft_placement: true
, '_tf_random_seed': None, '_task_type': None, '_environment': 'local', '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7fa70e534d50>, '_tf_config': gpu_options {
per_process_gpu_memory_fraction: 1.0
}
, '_num_worker_replicas': 0, '_task_id': 0, '_save_summary_steps': 100, '_save_checkpoints_steps': 200, '_evaluation_master': '', '_keep_checkpoint_every_n_hours': 10000, '_master': '', '_log_step_count_steps': 100}
WARNING:tensorflow:uid (from tensorflow.contrib.learn.python.learn.estimators.run_config) is experimental and may change or be removed at any time, and without warning.
WARNING:tensorflow:From /home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/monitors.py:269: init (from tensorflow.contrib.learn.python.learn.monitors) is deprecated and will be removed after 2016-12-05.
Instructions for updating:
Monitors are deprecated. Please use tf.train.SessionRunHook.
Loaded 60000 images of size [28, 28].
Loaded 60000 labels.
INFO:tensorflow:Create CheckpointSaverHook.
2017-09-13 16:49:51.776469: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-13 16:49:51.776488: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-13 16:49:51.776492: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-09-13 16:49:51.776496: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-13 16:49:51.776499: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
INFO:tensorflow:Saving checkpoints for 1 into output/cnn_classifier_mnist/model.ckpt.
INFO:tensorflow:predictions:0: 8
INFO:tensorflow:labels:0: 1
INFO:tensorflow:predictions:0: 8
INFO:tensorflow:labels:0: 9
INFO:tensorflow:predictions:0: 8
INFO:tensorflow:labels:0: 1
Loaded 10000 images of size [28, 28].
Loaded 10000 labels.
INFO:tensorflow:Starting evaluation at 2017-09-13-08:50:01
INFO:tensorflow:Restoring parameters from output/cnn_classifier_mnist/model.ckpt-1
INFO:tensorflow:Finished evaluation at 2017-09-13-08:50:04
INFO:tensorflow:Saving dict for global step 1: accuracy = 0.2329, global_step = 1, loss = 2.23739
INFO:tensorflow:Validation (step 1): loss = 2.23739, global_step = 1, accuracy = 0.2329
INFO:tensorflow:loss = 2.30457, step = 1
2017-09-13 16:51:48.898924: W tensorflow/core/framework/op_kernel.cc:1192] Unknown: exceptions.RuntimeError: main thread is not in main loop
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/liwq/Code/DataSet/TensorflowFramework/trainer.py", line 205, in
tf.app.run()
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/liwq/Code/DataSet/TensorflowFramework/trainer.py", line 201, in main
hparams=get_params())
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 209, in run
return _execute_schedule(experiment, schedule)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 46, in _execute_schedule
return task()
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 502, in train_and_evaluate
self.train(delay_secs=0)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 280, in train
hooks=self._train_monitors + extra_hooks)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 672, in _call_train
hooks=hooks)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 241, in train
loss = self._train_model(input_fn=input_fn, hooks=hooks)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 686, in _train_model
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/training/monitored_session.py", line 518, in run
run_metadata=run_metadata)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/training/monitored_session.py", line 862, in run
run_metadata=run_metadata)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/training/monitored_session.py", line 818, in run
return self._sess.run(*args, **kwargs)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/training/monitored_session.py", line 972, in run
run_metadata=run_metadata)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/training/monitored_session.py", line 818, in run
return self._sess.run(*args, **kwargs)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 895, in run
run_metadata_ptr)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1124, in _run
feed_dict_tensor, options, run_metadata)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1321, in _do_run
options, run_metadata)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1340, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.UnknownError: exceptions.RuntimeError: main thread is not in main loop
[[Node: PyFunc = PyFunc[Tin=[DT_FLOAT, DT_INT64], Tout=[DT_UINT8], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/cpu:0"](IteratorGetNext, ArgMax)]]

Caused by op u'PyFunc', defined at:
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/liwq/Code/DataSet/TensorflowFramework/trainer.py", line 205, in
tf.app.run()
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/liwq/Code/DataSet/TensorflowFramework/trainer.py", line 201, in main
hparams=get_params())
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 209, in run
return _execute_schedule(experiment, schedule)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 46, in _execute_schedule
return task()
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 502, in train_and_evaluate
self.train(delay_secs=0)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 280, in train
hooks=self._train_monitors + extra_hooks)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 672, in _call_train
hooks=hooks)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 241, in train
loss = self._train_model(input_fn=input_fn, hooks=hooks)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 630, in _train_model
model_fn_lib.ModeKeys.TRAIN)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/estimator/estimator.py", line 615, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/home/liwq/Code/DataSet/TensorflowFramework/trainer.py", line 132, in _model_fn
predictions, loss, metrics = model_fn(features, labels, mode, params)
File "model/cnn_classifier.py", line 46, in model
summary.labeled_image("images", images, predictions)
File "common/summary.py", line 49, in labeled_image
figs = tf.py_func(_visualize_images, [images, labels], tf.uint8)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/ops/script_ops.py", line 203, in py_func
input=inp, token=token, Tout=Tout, name=name)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_script_ops.py", line 36, in _py_func
name=name)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
op_def=op_def)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2630, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1204, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

UnknownError (see above for traceback): exceptions.RuntimeError: main thread is not in main loop
[[Node: PyFunc = PyFunc[Tin=[DT_FLOAT, DT_INT64], Tout=[DT_UINT8], token="pyfunc_0", _device="/job:localhost/replica:0/task:0/cpu:0"](IteratorGetNext, ArgMax)]]

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/matplotlib/_pylab_helpers.py", line 92, in destroy_all
manager.destroy()
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 619, in destroy
self.window.destroy()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1862, in destroy
for c in self.children.values(): c.destroy()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2100, in destroy
self.tk.call('destroy', self._w)
RuntimeError: main thread is not in main loop
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/matplotlib/_pylab_helpers.py", line 92, in destroy_all
manager.destroy()
File "/home/liwq/.virtualenvs/py2env/local/lib/python2.7/site-packages/matplotlib/backends/backend_tkagg.py", line 619, in destroy
self.window.destroy()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1862, in destroy
for c in self.children.values(): c.destroy()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 2100, in destroy
self.tk.call('destroy', self._w)
RuntimeError: main thread is not in main loop

Regularization losses added only once

In this line

 https://github.com/vahidk/TensorflowFramework/blob/master/common/optimizer.py#L99
`` `
You have added Regularization losses for the 1 gpu scope but loss is added for all gpu scopes. Any reason behind it ?

Please add a license to this repo

Could you please add an explicit LICENSE file to the repo so that it's clear under what terms the content is provided, and under what terms user contributions are licensed?

Per GitHub docs on licensing:

[...] without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work. If you're creating an open source project, we strongly encourage you to include an open source license.

Thanks!

Max-pooling

Hi,

I tried to apply the AlexNet model with max-pooling on MNIST (by adding pool_method="max" in model/alexnet. py), not with strided_conv2d.
But I get the following error:

Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/vrbkind/test/TensorflowFramework/trainer.py", line 128, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "/home/alexandre/test/TensorflowFramework/trainer.py", line 124, in main
MODELS[FLAGS.model], DATASETS[FLAGS.dataset], FLAGS.hparams))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 218, in run
return _execute_schedule(experiment, schedule)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 46, in _execute_schedule
return task()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 625, in train_and_evaluate
self.train(delay_secs=0)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 367, in train
hooks=self._train_monitors + extra_hooks)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 807, in _call_train
hooks=hooks)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 302, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 711, in _train_model
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 694, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "common/optimizer.py", line 146, in _model_fn
stats = tf.profiler.profile(tf.get_default_graph(), options=opts)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/profiler/model_analyzer.py", line 312, in profile
graph, op_log, run_meta, add_trace=cmd == 'code')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/profiler/tfprof_logger.py", line 146, in _merge_default_with_oplog
graph, run_meta, add_trace=add_trace, add_trainable_var=add_trainable_var)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/profiler/tfprof_logger.py", line 88, in _get_logged_ops
graph, op.node_def, REGISTERED_FLOP_STATS)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2362, in get_stats_for_node_def
result = stats_func(graph, node)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/profiler/internal/flops_registry.py", line 378, in _max_pool_grad_flops
max_pool_ops = kernel_area * orig_out_shape.num_elements()
TypeError: unsupported operand type(s) for *: 'long' and 'NoneType'

I use Tensorflow 1.4.0 with Python 2.7.12 (the problem is the same with 3.5.7)

I thank you in advance for your help.

Add the abstract class and functions for base dataset

Now all the dataset files(mnist, cifar10, cifar100) are implementing the same functions with same parameters. I think these are required.

It would be great if we have the abstract class and functions so that we know how to extend our dataset.

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.