运行这个文件,会报错'NoneType' object has no attribute '_inbound_nodes'。
Traceback (most recent call last):
File "/home/xuwei/Downloads/pycharm-professional-2021.3.3/pycharm-2021.3.3/plugins/python/helpers/pydev/pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/xuwei/Downloads/pycharm-professional-2021.3.3/pycharm-2021.3.3/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/xuwei/Downloads/FewCLUE-main/baselines/models_keras/ptuning_origin/ptuning_sentiment.py", line 135, in
model, train_model = get_model(pattern_len=unused_length, trainable=True, lr=3e-5)
File "/home/xuwei/Downloads/FewCLUE-main/baselines/models_keras/ptuning_origin/modeling.py", line 154, in get_model
model = build_transformer_model(
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/bert4keras/models.py", line 2441, in build_transformer_model
transformer.build(configs)
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/bert4keras/models.py", line 96, in build
self.model = Model(self.inputs, self.outputs, name=self.name)
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, *kwargs)
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 94, in init
self._init_graph_network(args, kwargs)
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 240, in _init_graph_network
nodes, nodes_by_depth, layers, layers_by_depth = _map_graph_network(
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1431, in _map_graph_network
build_map(x, finished_nodes, nodes_in_progress,
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1420, in build_map
build_map(x, finished_nodes, nodes_in_progress, layer,
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1420, in build_map
build_map(x, finished_nodes, nodes_in_progress, layer,
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1420, in build_map
build_map(x, finished_nodes, nodes_in_progress, layer,
[Previous line repeated 50 more times]
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1393, in build_map
node = layer._inbound_nodes[node_index]
AttributeError: 'NoneType' object has no attribute '_inbound_nodes'
python-BaseException
能否修复下
运行这个文件,会报错'NoneType' object has no attribute '_inbound_nodes'。 Traceback (most recent call last): File "/home/xuwei/Downloads/pycharm-professional-2021.3.3/pycharm-2021.3.3/plugins/python/helpers/pydev/pydevd.py", line 1483, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "/home/xuwei/Downloads/pycharm-professional-2021.3.3/pycharm-2021.3.3/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/xuwei/Downloads/FewCLUE-main/baselines/models_keras/ptuning_origin/ptuning_sentiment.py", line 135, in
model, train_model = get_model(pattern_len=unused_length, trainable=True, lr=3e-5)
File "/home/xuwei/Downloads/FewCLUE-main/baselines/models_keras/ptuning_origin/modeling.py", line 154, in get_model
model = build_transformer_model(
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/bert4keras/models.py", line 2441, in build_transformer_model
transformer.build(configs)
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/bert4keras/models.py", line 96, in build
self.model = Model(self.inputs, self.outputs, name=self.name)
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, *kwargs)
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 94, in init
self._init_graph_network(args, kwargs)
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 240, in _init_graph_network
nodes, nodes_by_depth, layers, layers_by_depth = _map_graph_network(
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1431, in _map_graph_network
build_map(x, finished_nodes, nodes_in_progress,
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1420, in build_map
build_map(x, finished_nodes, nodes_in_progress, layer,
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1420, in build_map
build_map(x, finished_nodes, nodes_in_progress, layer,
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1420, in build_map
build_map(x, finished_nodes, nodes_in_progress, layer,
[Previous line repeated 50 more times]
File "/home/xuwei/anaconda3/lib/python3.8/site-packages/keras/engine/network.py", line 1393, in build_map
node = layer._inbound_nodes[node_index]
AttributeError: 'NoneType' object has no attribute '_inbound_nodes'
python-BaseException
能否修复下