nikhil-dev / hawkeye

A perception system for ball tracking in cricket and tennis.
42 stars 15 forks source link

Cant able to compile the code base #2

Open Muthukumar-S1979 opened 5 years ago

Muthukumar-S1979 commented 5 years ago

hi nikil

Thanks for sharing wonderful impressive work.

I tried to compile the code base seem there are something missing in the main.py. I am getting below error almost for every where

Error 1: File "main.py", line 47, in for x in (tfe.Iterator(dataset)): NameError: name 'dataset' is not defined

Error 2: for (batch, (videos, targets)) in enumerate(tfe.Iterator(dataset)):

with tf.contrib.summary.record_summaries_every_n_global_steps(log_interval):

batch_model_loss = functools.partial(model_loss, targets, videos, hawkeye_net)
optimizer.minimize(batch_model_loss, global_step=tf.train.get_global_step())

The above loop has been kept outside the main, actually where it should be present ? Error 3: The below loop also seems kept outside and could not able to find "dataset" (getting error dataset not defined)

for x in (tfe.Iterator(dataset)): images, labels = x with tf.contrib.summary.record_summaries_every_n_global_steps(10): batch_model_loss = functools.partial(model_loss, labels, images) optimizer.minimize(batch_model_loss, global_step=tf.train.get_global_step())

Error 4 : Traceback (most recent call last): File "main.py", line 244, in print(args.accumulate(args.integers)) AttributeError: 'Namespace' object has no attribute 'accumulate'

Error 5: I try to comment block mentioned in "Error 2 and Error 3" now am getting "FlAGS not defined" . I tried to compile with "python main.py --pretrain-cnn" Traceback (most recent call last): File "main.py", line 97, in num_layer_1_filters=FLAGS.num_layer_1_filters, NameError: name 'FLAGS' is not defined

Error 4: Over all indentation , which function should be placed where.

Am i doing some thing silly over here, request your guidance to compile your code base.

Request you to share the proper running code , so that i can test it

Thanks, Muthukumar

Muthukumar-S1979 commented 5 years ago

nikil,

I could able to fix the indentation issue and the code started compiling now. Due to tensorflow up-gradation , seems some of your logic's are not working . Please find below error during compilation . I believe the error or due to tf version mismatch and array outof bounds issue . Could you please check the issues and fix it with tensor flow (am using tf 1.14.0). Looking forward for your reply

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/ops/script_ops.py", line 209, in call ret = func(*args)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/data/ops/dataset_ops.py", line 514, in generator_py_func values = next(generator_state.get_iterator(iterator_id))

File "/home/dev-2/Work/ball_trajectory_RandD/hawkeye-master/data_utils.py", line 147, in data_generator dense_shape=[IMAGE_SIZE[0]/10, IMAGE_SIZE[1]/10, 3])

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/framework/sparse_tensor.py", line 128, in init indices, name="indices", dtype=dtypes.int64)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1087, in convert_to_tensor return convert_to_tensor_v2(value, dtype, preferred_dtype, name)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1145, in convert_to_tensor_v2 as_ref=False)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 1224, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py", line 305, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py", line 246, in constant allow_broadcast=True)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py", line 254, in _constant_impl t = convert_to_eager_tensor(value, ctx, dtype)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py", line 115, in convert_to_eager_tensor return ops.EagerTensor(value, handle, device, dtype)

File "/hawkeye-master/data_utils.py", line 99, in sequence_data_generator sequence.append(place_ball_on_image(base_image, bm, ball_loc))

File "/hawkeye-master/data_utils.py", line 165, in place_ball_on_image padding_bottom = image_dim[0] - padding_top - ball_dim[0]

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 680, in _slice_helper name=name)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 846, in strided_slice shrink_axis_mask=shrink_axis_mask)

File "/home/dev-2/.virtualenvs/cv_py3/lib/python3.5/site-packages/tensorflow/python/ops/gen_array_ops.py", line 9967, in strided_slice _six.raise_from(_core._status_to_exception(e.code, message), None)

File "", line 3, in raise_from

tensorflow.python.framework.errors_impl.InvalidArgumentError: slice index 0 of dimension 0 out of bounds. [Op:StridedSlice] name: strided_slice/

     [[{{node PyFunc}}]] [Op:IteratorGetNextSync]

2019-09-17 16:48:47.173271: W tensorflow/core/kernels/data/generator_dataset_op.cc:80] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated. [[{{node PyFunc}}]]

**TypeError: Cannot convert provided value to EagerTensor. Provided value: [[27.6, 15.88888888888889, 0], [27.6, 15.88888888888889, 1], [27.6, 15.88888888888889, 2]] Requested dtype: int64

[[{{node PyFunc}}]] [Op:IteratorGetNextSync] 2019-09-17 18:13:55.987132: W tensorflow/core/kernels/data/generator_dataset_op.cc:80] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated. [[{{node PyFunc}}]]** (cv_py3) dev-2@dev:~/hawkeye-master$