antonior92/automatic-ecg-diagnosis

ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type int).

somewayin opened this issue · 0 comments

Hello!
I use the data set mentioned in the article:CODE-15%: a large scale annotated dataset of 12-lead ECGs
But I really can't solve this problem,The following is the error message:

File "D:\NutnetDisk\CODE\PYCHARMProject\automatic-ecg-diagnosis-master\train.py", line 53, in
verbose=1)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\keras\engine\training.py", line 66, in _method_wrapper
return method(self, *args, **kwargs)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\keras\engine\training.py", line 815, in fit
model=self)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1112, in init
model=model)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 908, in init
**kwargs)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 775, in init
peek = _process_tensorlike(peek)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1013, in _process_tensorlike
inputs = nest.map_structure(_convert_numpy_and_scipy, inputs)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\util\nest.py", line 617, in map_structure
structure[0], [func(*x) for x in entries],
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\util\nest.py", line 617, in
structure[0], [func(*x) for x in entries],
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1008, in _convert_numpy_and_scipy
return ops.convert_to_tensor(x, dtype=dtype)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\framework\ops.py", line 1341, in convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\framework\tensor_conversion_registry.py", line 52, in _default_conversion_function
return constant_op.constant(value, dtype, name=name)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\framework\constant_op.py", line 262, in constant
allow_broadcast=True)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\framework\constant_op.py", line 270, in _constant_impl
t = convert_to_eager_tensor(value, ctx, dtype)
File "C:\Users\ty.conda\envs\mul-auto-ecg\lib\site-packages\tensorflow\python\framework\constant_op.py", line 96, in convert_to_eager_tensor
return ops.EagerTensor(value, ctx.device_name, dtype)
ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type int).