SystemErrorWang / White-box-Cartoonization

Official tensorflow implementation for CVPR2020 paper “Learning to Cartoonize Using White-box Cartoon Representations”

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"ValueError: setting an array element with a sequence." in "pretrain.py", line 83

Oloph opened this issue · comments

Hi SystemErrorWang,

First of all Amazing work! The pretained results look amazing. Getting into train_code/... though, I've been getting an error that is persistent. Please see end of this report. Question -- is this a numpy+tf version issues? or could it be something with my input example photos? Or is this a coding issue? Any help would be greatly appreciated.

(whiteboxcartoon) bash-4.2$ conda list | grep tensorflow
tensorflow 1.12.0 gpu_py36he68c306_0
tensorflow-base 1.12.0 gpu_py36h8e0ae2d_0
tensorflow-gpu 1.12.0 h0d30ee6_0
(whiteboxcartoon) bash-4.2$ conda list | grep numpy
numpy 1.14.6 py36h3b04361_5
numpy-base 1.14.6 py36hde5b4d6_5

thanks,
jling

-------------------------------Error Below----------------------------------

(whiteboxcartoon) bash-4.2$ pwd
/home/jling/conda/envs/whiteboxcartoon/sand/White-box-Cartoonization/train_code
(whiteboxcartoon) bash-4.2$ python pretrain.py
2020-12-31 17:24:43.210381: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2020-12-31 17:24:43.370386: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-12-31 17:24:43.371656: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties:
name: Quadro P6000 major: 6 minor: 1 memoryClockRate(GHz): 1.645
pciBusID: 0000:00:0e.0
totalMemory: 23.88GiB freeMemory: 20.69GiB
2020-12-31 17:24:43.371688: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2020-12-31 17:24:43.828884: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-12-31 17:24:43.828935: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0
2020-12-31 17:24:43.828946: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N
2020-12-31 17:24:43.829094: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 12224 MB memory) -> physical GPU (device: 0, name: Quadro P6000, pci bus id: 0000:00:0e.0, compute capability: 6.1)
0%| | 0/50000 [00:05<?, ?it/s]
Traceback (most recent call last):
File "pretrain.py", line 115, in
train(args)
File "pretrain.py", line 83, in train
_, r_loss = sess.run([optim, recon_loss], feed_dict={input_photo: photo_batch})
File "/pixar/ws/trees/jling/conda/envs/whiteboxcartoon/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/pixar/ws/trees/jling/conda/envs/whiteboxcartoon/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1121, in _run
np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
File "/pixar/ws/trees/jling/conda/envs/whiteboxcartoon/lib/python3.6/site-packages/numpy/core/numeric.py", line 492, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: setting an array element with a sequence.
(whiteboxcartoon) bash-4.2$

@Oloph It seems to be a probelm with dataloader? you are trying to convert a sequence to a numpy array?
maybe you can test the dataloader alone and see what it returns.

Thanks SystemErrorWang! I'll give that a try

Hi ! I have the same problem.

I didn't have modified the code of pretrain and utils.

I can't resolve it, because I do not master numpy and sequence type.

Versions :

Tensorflow-gpu 1.12.0
numpy 1.14.6
Cuda 9
Cudnn 7
Python 3.6.0

Thanks.

Error code :

Traceback (most recent call last):
File "C:\Users\leocu\Desktop\White-box-Cartoonization-master\train_code\pretrain.py", line 115, in
train(args)
File "C:\Users\leocu\Desktop\White-box-Cartoonization-master\train_code\pretrain.py", line 83, in train
_, r_loss = sess.run([optim, recon_loss], feed_dict={input_photo: photo_batch})
File "C:\Users\leocu\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 929, in run
run_metadata_ptr)
File "C:\Users\leocu\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1121, in _run
np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
File "C:\Users\leocu\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\numeric.py", line 492, in asarray
return array(a, dtype, copy=False, order=order)
ValueError: setting an array element with a sequence.

Hi ! I have the same problem.

I didn't have modified the code of pretrain and utils.

I can't resolve it, because I do not master numpy and sequence type.

Versions :

Tensorflow-gpu 1.12.0 numpy 1.14.6 Cuda 9 Cudnn 7 Python 3.6.0

Thanks.

Error code :

Traceback (most recent call last): File "C:\Users\leocu\Desktop\White-box-Cartoonization-master\train_code\pretrain.py", line 115, in train(args) File "C:\Users\leocu\Desktop\White-box-Cartoonization-master\train_code\pretrain.py", line 83, in train _, r_loss = sess.run([optim, recon_loss], feed_dict={input_photo: photo_batch}) File "C:\Users\leocu\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 929, in run run_metadata_ptr) File "C:\Users\leocu\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\client\session.py", line 1121, in _run np_val = np.asarray(subfeed_val, dtype=subfeed_dtype) File "C:\Users\leocu\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\numeric.py", line 492, in asarray return array(a, dtype, copy=False, order=order) ValueError: setting an array element with a sequence.

Hi, were you solved it? I have this problem too