tf-encrypted / tf-encrypted

A Framework for Encrypted Machine Learning in TensorFlow

Home Page:https://tf-encrypted.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation fault and No module named 'tf_encrypted.protocol.aby3' happened after upgrading aby3

yujingyue9166 opened this issue · comments

When I run aby3_test.py and pond_test.py, Segmentation fault occured after upgrading aby3 version. Before they run well. And I run examples/benchmark/sort_and_max/aby3_profile.py, there are ModuleNotFoundError: No module named 'tf_encrypted.protocol.aby3'.
I have tried both versions of the installation (from the source and using pip install tf-encrpted), but both had the same problems.

Currently sort_and_max could only be used by building from source. Could you report your python and tf version ?

Currently sort_and_max could only be used by building from source. Could you report your python and tf version ?

My python version is 3.7.11 and the tensorflow version is 1.15.2.

Currently sort_and_max could only be used by building from source. Could you report your python and tf version ?

My python version is 3.7.11 and the tensorflow version is 1.15.2.

When I tried in Python 3.6.15 and TF 1.13.2, I got the TypeError: can only concatenate list (not "TensorShapeV1") to list. Specifically,
Traceback (most recent call last):
File "aby3_profile.py", line 30, in test_sort_performance
private_x = tfe.define_private_variable(x)
File "tf-encrypted/tf_encrypted/protocol/aby3/aby3.py", line 432, in define_private_variable
shares = self._share(v, share_type=share_type)
File "tf-encrypted/tf_encrypted/protocol/aby3/aby3.py", line 924, in _share
randoms = secret.factory.sample_uniform([2] + secret.shape)
TypeError: can only concatenate list (not "TensorShapeV1") to list

And using Python 3.6.15 and TF 1.14.0, I got another error: tensorflow.python.framework.errors_impl.InternalError: empty shape_inference::InferenceContext pointer for 'pair-randomness-setup/seed0' (op: 'SecureSeed') with input shapes: .

Never encountered these.. could you download and build TFE from source in a fresh new linux environment and see if the error happens again?

git clone https://github.com/tf-encrypted/tf-encrypted.git
cd tf-encrypted
pip install -e .
make build

I tried in a fresh new linux environment with Python 3.6.15 and TF 1.15.0. It can work well. But for TF 1.13.2 and 1.14.0, the same errors ocurred.
Thank you for replying.

@yujingyue9166

  1. For python 3.6.15 + tf 1.13.2, it will be fixed by this PR: #864
  2. For python 3.6.15 + tf 1.14.0, it will NOT work due to a bug in tf 1.14.0
  3. For python 3.7.11 + tf.15.2, I have tested it and it does work. So, my best guess is, your pip install -e . or make build command do not end successfully. Please verify them. Module tf_encrypted.protocol.aby3 just locates at ./tf_encrypted/protocol/aby3. Please check whether you can find it.

@yujingyue9166

  1. For python 3.6.15 + tf 1.13.2, it will be fixed by this PR: Fix compatibility #864
  2. For python 3.6.15 + tf 1.14.0, it will NOT work due to a bug in tf 1.14.0
  3. For python 3.7.11 + tf.15.2, I have tested it and it does work. So, my best guess is, your pip install -e . or make build command do not end successfully. Please verify them. Module tf_encrypted.protocol.aby3 just locates at ./tf_encrypted/protocol/aby3. Please check whether you can find it.

Thank you for a quick reply. I found that I failed in installing tf-encrypted, becauce that "No matching distribution found for tf-big~=0.1.0" in Python 3.7.11 on Centos 7.6.