Opened 5 years ago

Last modified 5 years ago

#58331 assigned defect

Tensorflow freezes

Reported by: ptighin Owned by: emcrisostomo (Enrico Maria Crisostomo)
Priority: Normal Milestone:
Component: ports Version: 2.5.4
Keywords: Cc: cjones051073 (Chris Jones)
Port: py-tensorflow

Description (last modified by ptighin)

The macports version of tensorflow (both py36-tensorflow and py37-tensorflow) freezes when running a very simple script, e.g.,

import tensorflow as tf
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')

I don't think the problem lies in the tensorflow binary itself but rather somewhere in its dependencies. Evidence: installing the tensorflow binary with pip (with all other dependencies still from macports) does not solve the issue.

The issue is solved only when I create a clean virtual environment and install everything with pip.

I've done a bit of research and it turns out that the execution freezes when running

  const_tensor = g.create_op(
      "Const", [], [dtype_value.type],
      attrs={"value": tensor_value,
             "dtype": dtype_value},
      name=name).outputs[0]

inside the file /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py.

The tensorflow version is py37-tensorflow @1.13.1.

Change History (3)

comment:1 Changed 5 years ago by ptighin

Description: modified (diff)

comment:2 Changed 5 years ago by mf2k (Frank Schima)

Cc: cjones051073 added; emcrisostomo@… jonesc@… removed
Owner: set to emcrisostomo
Port: py-tensorflow added; py37-tensorflow removed
Status: newassigned

comment:3 Changed 5 years ago by cjones051073 (Chris Jones)

I see the same. I have no solution to offer, other than the comment I agree its probably some dependency.

Just for reference in case anyone finds it useful this is the complete traceback from aborting during the hangup

>>> a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
^CTraceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 179, in constant_v1
    allow_broadcast=False)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 289, in _constant_impl
    name=name).outputs[0]
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
    op_def=op_def)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1823, in __init__
    control_input_ops)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1652, in _create_c_op
    for name, attr_value in node_def.attr.items():
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/_collections_abc.py", line 743, in __iter__
    for key in self._mapping:
Note: See TracTickets for help on using tickets.