Python Forum

Full Version: Why do I keep getting this traceback? -- Stack Extract Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey Guys,
I keep getting this error while using TensorFlow. I am not sure what is causing it. If anyone has any idea what is causing this, please let me know!
Thanks,
Matt

Error:
self._traceback = tf_stack.extract_stack()
Here is the full output, maybe this helps?

Error:
2020-08-09 22:43:27.615201: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_100.dll'; dlerror: cudart64_100.dll not found 2020-08-09 22:43:27.615332: 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. 2020-08-09 22:43:29.430673: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-08-09 22:43:29.432321: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found 2020-08-09 22:43:29.432450: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303) 2020-08-09 22:43:29.434248: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: MattPC 2020-08-09 22:43:29.434436: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: MattPC WARNING:tensorflow:From C:\Users\Matthew\source\repos\Python2\Python2\Python2.py:57: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead. WARNING:tensorflow:From C:\Users\Matthew\source\repos\Python2\Python2\Python2.py:59: The name tf.random_normal is deprecated. Please use tf.random.normal instead. WARNING:tensorflow:From C:\Users\Matthew\source\repos\Python2\Python2\Python2.py:66: The name tf.train.GradientDescentOptimizer is deprecated. Please use tf.compat.v1.train.GradientDescentOptimizer instead. Traceback (most recent call last): File "C:\Users\Matthew\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call return fn(*args) File "C:\Users\Matthew\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1350, in _run_fn target_list, run_metadata) File "C:\Users\Matthew\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value Variable [[{{node Variable/read}}]] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Matthew\source\repos\Python2\Python2\Python2.py", line 169, in <module> avg,std=run_simulations(policy,budget,num_stocks,prices, hist) File "C:\Users\Matthew\source\repos\Python2\Python2\Python2.py", line 154, in run_simulations final_portfolio = run_simulation(policy, budget, num_stocks, prices, hist) File "C:\Users\Matthew\source\repos\Python2\Python2\Python2.py", line 103, in run_simulation action = policy.select_action(current_state, i) File "C:\Users\Matthew\source\repos\Python2\Python2\Python2.py", line 70, in select_action action_q_vals = self.sess.run(self.q,feed_dict={self.x: current_state}) File "C:\Users\Matthew\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run run_metadata_ptr) File "C:\Users\Matthew\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run feed_dict_tensor, options, run_metadata) File "C:\Users\Matthew\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run run_metadata) File "C:\Users\Matthew\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\client\session.py", line 1384, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.FailedPreconditionError: Attempting to use uninitialized value Variable [[node Variable/read (defined at \AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]] Original stack trace for 'Variable/read': File "\source\repos\Python2\Python2\Python2.py", line 163, in <module> policy = QLearningDecisionPolicy(actions, input_dim = 202) File "\source\repos\Python2\Python2\Python2.py", line 59, in __init__ W1 = tf.Variable(tf.random_normal([input_dim,h1_dim])) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\variables.py", line 258, in __call__ return cls._variable_v1_call(*args, **kwargs) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\variables.py", line 219, in _variable_v1_call shape=shape) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\variables.py", line 197, in <lambda> previous_getter = lambda **kwargs: default_variable_creator(None, **kwargs) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\variable_scope.py", line 2519, in default_variable_creator shape=shape) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\variables.py", line 262, in __call__ return super(VariableMetaclass, cls).__call__(*args, **kwargs) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\variables.py", line 1688, in __init__ shape=shape) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\variables.py", line 1872, in _init_from_args self._snapshot = array_ops.identity(self._variable, name="read") File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\util\dispatch.py", line 180, in wrapper return target(*args, **kwargs) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\array_ops.py", line 203, in identity ret = gen_array_ops.identity(input, name=name) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\ops\gen_array_ops.py", line 4239, in identity "Identity", input=input, name=name) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\framework\op_def_library.py", line 794, in _apply_op_helper op_def=op_def) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 507, in new_func return func(*args, **kwargs) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3357, in create_op attrs, op_def, compute_device) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3426, in _create_op_internal op_def=op_def) File "\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1748, in __init__ self._traceback = tf_stack.extract_stack()