Code Monkey home page Code Monkey logo

capsnet's People

Contributors

rhymesg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

capsnet's Issues

请教main_capsnet.py在windows中运行的问题。

 非常感谢作者您可以提供capsnet胶囊网络应用在交通预测的源码。我在windows系统下运行main_capsnet.py文件试图用capsnet训练预测您项目中提供的交通数据集,但遇到了我无法解决的运行报错问题,以下是运行的部分输出(因为这里提问无法提供截图,实在抱歉),希望您能指点一下。非常期待您的回复!

刚开始是有正确的输出(后面就开始报错),以下是正确的输出:
Traffic data loaded from: data/Santander_ST_speed_pp_case1.csv
Number of data: 5000 = 53 days Number of sensors: 50
First 3750 data => trainning set, the other 1250 data => evaluation set
first idx_end of eval: 11
last idx_end of eval: 1250
Placeholder [1, 10, 50, 1]
conv1/2/Relu [1, 10, 50, 32]
PrimaryCaps_layer/Relu [1, 10, 50, 128]
Reshape [1, 8000, 8, 1]
Squeeze [1, 50, 16, 1]
ft/flatten/Reshape [1, 50]

Number of epoch: 3738

一下是报错的部分:
2022-04-10 18:42:36.601941: W T:\src\github\tensorflow\tensorflow\core\common_runtime\bfc_allocator.cc:279] **********************************************************************______________________________
2022-04-10 18:42:36.602367: W T:\src\github\tensorflow\tensorflow\core\framework\op_kernel.cc:1318] OP_REQUIRES failed at random_op.cc:202 : Resource exhausted: OOM when allocating tensor with shape[1,8000,800,8,1] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
Traceback (most recent call last):
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\client\session.py", line 1322, in _do_call
return fn(*args)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\client\session.py", line 1307, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\client\session.py", line 1409, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,8000,800,8,1] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[Node: Weight/Adam_1/Assign = Assign[T=DT_FLOAT, _class=["loc:@Weight/Assign"], _grappler_relax_allocator_constraints=true, use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Weight/Adam_1, Weight/Adam/Initializer/zeros)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:/PycharmProjects/CapsNet-master/main_capsnet.py", line 529, in
tf.app.run(main=main)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "D:/PycharmProjects/CapsNet-master/main_capsnet.py", line 96, in main
train()
File "D:/PycharmProjects/CapsNet-master/main_capsnet.py", line 215, in train
sess.run(tf.global_variables_initializer())
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\client\session.py", line 900, in run
run_metadata_ptr)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\client\session.py", line 1135, in _run
feed_dict_tensor, options, run_metadata)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\client\session.py", line 1316, in _do_run
run_metadata)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\client\session.py", line 1335, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[1,8000,800,8,1] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[Node: Weight/Adam_1/Assign = Assign[T=DT_FLOAT, _class=["loc:@Weight/Assign"], _grappler_relax_allocator_constraints=true, use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Weight/Adam_1, Weight/Adam/Initializer/zeros)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

Caused by op 'Weight/Adam_1/Assign', defined at:
File "D:/PycharmProjects/CapsNet-master/main_capsnet.py", line 529, in
tf.app.run(main=main)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "D:/PycharmProjects/CapsNet-master/main_capsnet.py", line 96, in main
train()
File "D:/PycharmProjects/CapsNet-master/main_capsnet.py", line 205, in train
optimizer = tf.train.AdamOptimizer(learning_rate).minimize(total_loss, global_step=step)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\training\optimizer.py", line 409, in minimize
name=name)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\training\optimizer.py", line 585, in apply_gradients
self._create_slots(var_list)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\training\adam.py", line 128, in _create_slots
self._zeros_slot(v, "v", self._name)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\training\optimizer.py", line 1130, in _zeros_slot
new_slot_variable = slot_creator.create_zeros_slot(var, op_name)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\training\slot_creator.py", line 181, in create_zeros_slot
colocate_with_primary=colocate_with_primary)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\training\slot_creator.py", line 155, in create_slot_with_initializer
dtype)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\training\slot_creator.py", line 65, in _create_slot_var
validate_shape=validate_shape)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1328, in get_variable
constraint=constraint)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 1090, in get_variable
constraint=constraint)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 435, in get_variable
constraint=constraint)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 404, in _true_getter
use_resource=use_resource, constraint=constraint)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 796, in _get_single_variable
use_resource=use_resource)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 2234, in variable
use_resource=use_resource)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 2224, in
previous_getter = lambda **kwargs: default_variable_creator(None, **kwargs)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variable_scope.py", line 2207, in default_variable_creator
constraint=constraint)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variables.py", line 259, in init
constraint=constraint)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\variables.py", line 412, in _init_from_args
validate_shape=validate_shape).op
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\state_ops.py", line 219, in assign
validate_shape=validate_shape)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\ops\gen_state_ops.py", line 63, in assign
use_locking=use_locking, name=name)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\framework\ops.py", line 3414, in create_op
op_def=op_def)
File "E:\Anaconda\envs\tensorflow1.9.0\lib\site-packages\tensorflow\python\framework\ops.py", line 1740, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

ResourceExhaustedError (see above for traceback): OOM when allocating tensor with shape[1,8000,800,8,1] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
[[Node: Weight/Adam_1/Assign = Assign[T=DT_FLOAT, _class=["loc:@Weight/Assign"], _grappler_relax_allocator_constraints=true, use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Weight/Adam_1, Weight/Adam/Initializer/zeros)]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

Process finished with exit code 1

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.