OpenMined / TenSEAL

A library for doing homomorphic encryption operations on tensors
Apache License 2.0
837 stars 158 forks source link

bug appears when the number of layers is increased #374

Open emad-cio opened 2 years ago

emad-cio commented 2 years ago

Description

bug appears when the number of layers is increased .

error:

ValueError Traceback (most recent call last)

in 1 enc_model = EncConvNet(model) ----> 2 enc_test(context, enc_model, test_loader, criterion, kernel_shape, stride) in enc_test(context, model, test_loader, criterion, kernel_shape, stride) 90 ) 91 # Encrypted evaluation ---> 92 enc_output = enc_model(x_enc, windows_nb) 93 # Decryption of result 94 output = enc_output.decrypt() in __call__(self, *args, **kwargs) 74 75 def __call__(self, *args, **kwargs): ---> 76 return self.forward(*args, **kwargs) 77 78 in forward(self, enc_x, windows_nb) 40 enc_channels = [] 41 for kernel, bias in zip(self.conv1_weight, self.conv1_bias): ---> 42 y = enc_x.conv2d_im2col(kernel, windows_nb) + bias 43 44 enc_channels.append(y) C:\Anaconda3\envs\tensorflow\lib\site-packages\tenseal\tensors\ckksvector.py in conv2d_im2col(self, other, windows_nb) 181 182 def conv2d_im2col(self, other, windows_nb) -> "CKKSVector": --> 183 other = self._conv2d_im2col(other) 184 return self._wrap(self.data.conv2d_im2col(other, windows_nb)) 185 ValueError: can't execute conv2d_im2col on chunked vectors ## How to Reproduce 1. Go to '...' 2. Click on '...' 3. Scroll down to '...' 4. See error ## Expected Behavior A clear and concise description of what you expected to happen. ## Screenshots If applicable, add screenshots to help explain your problem. ## System Information - OS: [e.g. iOS] - OS Version: [e.g. 22] - Language Version: [e.g. Python 3.7, Node 10.18.1] - Package Manager Version: [e.g. Conda 4.6.1, NPM 6.14.1] - Browser (if applicable): [e.g. Google Chrome] - Browser Version (if applicable): [e.g. 81.0.4044.138] ## Additional Context Add any other context about the problem here.
JoeBater commented 1 year ago

Get the same - am running tutorial 4 code as provided except with the FG-VC Aircraft pytorch dataset (which has been grayscaled and center-cropped to 224x224). Win 11 Python 3.9.13 Conda 23.1.10 VS code 1.78.0

mayank64ce commented 5 months ago

@JoeBater @emad-cio were any of you able to solve this error ?