Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'list' object has no attribute 'asnumpy' #35

Open
shuaih97 opened this issue Jun 7, 2023 · 1 comment
Open

AttributeError: 'list' object has no attribute 'asnumpy' #35

shuaih97 opened this issue Jun 7, 2023 · 1 comment

Comments

@shuaih97
Copy link

shuaih97 commented Jun 7, 2023

您好!感谢您的工作,我正在尝试您的代码。请问AttributeError: 'list' object has no attribute 'asnumpy'的问题该怎么解决?我用的是mxnet-cu100==1.7.0。请问您当初用的是哪个版本的?mxnet的版本不同似乎会造成非常多的问题。
Traceback (most recent call last):
File "main_4n0_3layer_12T_res.py", line 27, in
net = construct_model(config)
File "/work/users/s/h/shuaishu/Transformer/STFGNN/utils_4n0_3layer_12T_res.py", line 41, in construct_model
init=mx.init.Constant(value=adj_mx.tolist()))
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/symbol/symbol.py", line 2864, in var
init = init.dumps()
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/initializer.py", line 477, in dumps
self._kwargs['value'] = val.tolist() if isinstance(val, np.ndarray) else val.asnumpy().tolist()
AttributeError: 'list' object has no attribute 'asnumpy'

@shuaih97
Copy link
Author

shuaih97 commented Jun 7, 2023

我换成mxnet-cu100==1.4.0解决了这个问题,但是又有个新的问题
CUDA driver version is insufficient for CUDA runtime version

Traceback (most recent call last):
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/symbol/symbol.py", line 1523, in simple_bind
ctypes.byref(exe_handle)))
File "/work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/base.py", line 252, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [02:54:45] src/storage/storage.cc:125: Check failed: e == cudaSuccess || e == cudaErrorCudartUnloading CUDA: CUDA driver version is insufficient for CUDA runtime version

Stack trace returned 10 entries:
[bt] (0) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x4015ca) [0x7fc1f0dce5ca]
[bt] (1) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x401be1) [0x7fc1f0dcebe1]
[bt] (2) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x34177eb) [0x7fc1f3de47eb]
[bt] (3) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x341b0f2) [0x7fc1f3de80f2]
[bt] (4) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x341c58d) [0x7fc1f3de958d]
[bt] (5) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::NDArray::NDArray(nnvm::TShape const&, mxnet::Context, bool, int)+0x816) [0x7fc1f35fddb6]
[bt] (6) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(void std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >::_M_emplace_back_aux<nnvm::TShape const&, mxnet::Context const&, bool, int const&>(nnvm::TShape const&, mxnet::Context const&, bool&&, int const&)+0xda) [0x7fc1f36c05ca]
[bt] (7) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::common::EmplaceBackZeros(mxnet::NDArrayStorageType, nnvm::TShape const&, mxnet::Context const&, int, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >)+0x365) [0x7fc1f36c0c55]
[bt] (8) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::exec::GraphExecutor::InitArguments(nnvm::IndexedGraph const&, std::vector<nnvm::TShape, std::allocatornnvm::TShape > const&, std::vector<int, std::allocator > const&, std::vector<int, std::allocator > const&, std::vector<mxnet::Context, std::allocatormxnet::Context > const&, std::vector<mxnet::Context, std::allocatormxnet::Context > const&, std::vector<mxnet::Context, std::allocatormxnet::Context > const&, std::vector<mxnet::OpReqType, std::allocatormxnet::OpReqType > const&, std::unordered_set<std::string, std::hashstd::string, std::equal_tostd::string, std::allocatorstd::string > const&, mxnet::Executor const
, std::unordered_map<std::string, mxnet::NDArray, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, mxnet::NDArray> > >, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >)+0xcbc) [0x7fc1f36c207c]
[bt] (9) /work/users/s/h/shuaishu/.conda/STFGNNpy37/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::exec::GraphExecutor::Init(nnvm::Symbol, mxnet::Context const&, std::map<std::string, mxnet::Context, std::lessstd::string, std::allocator<std::pair<std::string const, mxnet::Context> > > const&, std::vector<mxnet::Context, std::allocatormxnet::Context > const&, std::vector<mxnet::Context, std::allocatormxnet::Context > const&, std::vector<mxnet::Context, std::allocatormxnet::Context > const&, std::unordered_map<std::string, nnvm::TShape, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, nnvm::TShape> > > const&, std::unordered_map<std::string, int, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, int> > > const&, std::unordered_map<std::string, int, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, int> > > const&, std::vector<mxnet::OpReqType, std::allocatormxnet::OpReqType > const&, std::unordered_set<std::string, std::hashstd::string, std::equal_tostd::string, std::allocatorstd::string > const&, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >, std::unordered_map<std::string, mxnet::NDArray, std::hashstd::string, std::equal_tostd::string, std::allocator<std::pair<std::string const, mxnet::NDArray> > >, mxnet::Executor*, std::unordered_map<nnvm::NodeEntry, mxnet::NDArray, nnvm::NodeEntryHash, nnvm::NodeEntryEqual, std::allocator<std::pair<nnvm::NodeEntry const, mxnet::NDArray> > > const&)+0x76d) [0x7fc1f36d03bd]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant