zhouchunpong / gcn_keras Goto Github PK
View Code? Open in Web Editor NEW图卷积神经网络 Graph Convolutional Network with Keras
图卷积神经网络 Graph Convolutional Network with Keras
直接运行代码的时候,报错:setting an array element with a sequence
我的环境是:
win10
python 3.7
tensorflow 1.14.0
keras 2.3.1
另外,能否加个QQ请教一下?我的QQ是:2363405977
I got the following error when running model.fit. How do I fix it?
environment: python3.7 scipy 1.4.1 tensorflow 2.1.0
Using TensorFlow backend.
Loading cora dataset...
Dataset has 2708 nodes, 5429 edges, 1433 features.
Using local pooling filters...
2020-05-05 21:10:48.564918: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-05-05 21:10:48.581495: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f9c91ca7aa0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-05-05 21:10:48.581513: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
Traceback (most recent call last):
File ".../train.py", line 78, in
batch_size=A.shape[0], epochs=1, shuffle=False, verbose=0)
File "/usr/local/lib/python3.7/site-packages/keras/engine/training.py", line 1239, in fit
validation_freq=validation_freq)
File "/usr/local/lib/python3.7/site-packages/keras/engine/training_arrays.py", line 196, in fit_loop
outs = fit_function(ins_batch)
File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/keras/backend.py", line 3727, in call
outputs = self._graph_fn(*converted_inputs)
File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1551, in call
return self._call_impl(args, kwargs)
File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1591, in _call_impl
return self._call_flat(args, self.captured_inputs, cancellation_manager)
File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 1692, in _call_flat
ctx, args, cancellation_manager=cancellation_manager))
File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/eager/function.py", line 527, in call
(len(args), len(list(self.signature.input_arg))))
ValueError: Arguments and signature arguments do not match. got: 21, expected: 23
tf version: 1.14.0
Train on 2708 samples, validate on 2708 samples
Epoch 1/200
Traceback (most recent call last):
File "D:\JetBrains\Toolbox\apps\PyCharm-P\ch-0\201.6668.115\plugins\python\helpers\pydev\pydevd.py", line 1438, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\JetBrains\Toolbox\apps\PyCharm-P\ch-0\201.6668.115\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/PC/Desktop/GCN_Keras-master/train.py", line 85, in <module>
callbacks=[es_callback])
File "D:\python37\lib\site-packages\keras\engine\training.py", line 1239, in fit
validation_freq=validation_freq)
File "D:\python37\lib\site-packages\keras\engine\training_arrays.py", line 196, in fit_loop
outs = fit_function(ins_batch)
File "D:\python37\lib\site-packages\tensorflow\python\keras\backend.py", line 3277, in __call__
dtype=tensor_type.as_numpy_dtype))
File "D:\python37\lib\site-packages\numpy\core\_asarray.py", line 85, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: setting an array element with a sequence.
How to solve it?
你好,X = preprocess_features(X)这行代码显示Unresolved reference 'preprocess_features',似乎缺少这个模块,这个模块是在哪定义的呢?还是说这个函数就是后面一行的preprocess_adj()方法呢?
in MCGCN.py
line 25,26
A, X, y_train, y_val, y_test, train_mask, val_mask, test_mask = load_original_data( 'cora') # {'cora', 'citeseer', 'pubmed'}
X = preprocess_features(X)
运行:
predict = model.predict(X)
报错:
ValueError: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 6 array(s), but instead got the following list of 1 arrays: [array([[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 0., 0., 0.],
[0., 0., 0., ..., 0., 0., 0....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.