Comments (4)
Hi all, I think the issue is both the python version and the tensorflow version being used. We've used the following versions to test the library:
- Python
3.6
- Tensorflow
2.1
I am unable to reproduce your errors on my machine, please try to run the code with the above versions and let me know if there is any issue! Thanks.
This is the exact requirements.txt file.
Another solution would be to train a new AlexNet model on your end using the AlexNet train script provided in the repository.
from ml_privacy_meter.
Hi @SydSeyedi could you post the exact error message? It would be helpful to debug your issue.
from ml_privacy_meter.
Hi @amad-person Sorry for delay, your response skipped my attention.
When I use "pip install -r requirements.txt" and then in ipython I try: "import keras" I get the following error:
"Using TensorFlow backend.
2021-03-08 12:23:25.329609: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer.so.6'; dlerror: libnvinfer.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/rh/rh-python36/root/usr/lib64:/usr/lib64/mpich/lib:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 12:23:25.359718: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libnvinfer_plugin.so.6'; dlerror: libnvinfer_plugin.so.6: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /opt/rh/rh-python36/root/usr/lib64:/usr/lib64/mpich/lib:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64
2021-03-08 12:23:25.359807: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:30] Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
"
So I updated by:
"pip install tensorflow-gpu==2.2.0
pip install tensorflow==2.2.0"
but then
"cprefix = 'alexnet_pretrained'
cmodelA = tf.keras.models.load_model(cprefix)"
results in:
"privacy_meter/lib/python3.6/site-packages/tensorflow/python/keras/layers/core.py:1030: UserWarning: onnx2keras.reshape_layers is not loaded, but a Lambda layer uses it. It may cause errors.
, UserWarning)
XXX lineno: 161, opcode: 160"
and many lines of error ending with:
"privacy_meter/lib/python3.6/site-packages/tensorflow/python/keras/layers/core.py in target_layer(x)
159 [ 7.5 8.75]
160 [10. 0. ]], shape=(5, 2), dtype=float32)
--> 161
162 Arguments:
163 rate: Float between 0 and 1. Fraction of the input units to drop.
SystemError: unknown opcode
"
So, what would be the solution?
Thank you
from ml_privacy_meter.
Hello together, I got a similar error:
45: UserWarning: onnx2keras.reshape_layers is not loaded, but a Lambda layer uses it. It may cause errors.
, UserWarning)
XXX lineno: 160, opcode: 100
Traceback (most recent call last):
File "tutorials/attack_alexnet.py", line 13, in <module>
cmodelA = tf.keras.models.load_model(cprefix)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/saving/save.py", line 187, in load_model
return saved_model_load.load(filepath, compile, options)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 121, in load
path, options=options, loader_cls=KerasObjectLoader)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/saved_model/load.py", line 633, in load_internal
ckpt_options)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 194, in __init__
super(KerasObjectLoader, self).__init__(*args, **kwargs)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/saved_model/load.py", line 130, in __init__
self._load_all()
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 221, in _load_all
self._finalize_objects()
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 530, in _finalize_objects
self._reconstruct_all_models()
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 548, in _reconstruct_all_models
self._reconstruct_model(model_id, model, layers)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 589, in _reconstruct_model
config, created_layers={layer.name: layer for layer in layers})
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/engine/functional.py", line 1214, in reconstruct_from_config
process_node(layer, node_data)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/engine/functional.py", line 1162, in process_node
output_tensors = layer(input_tensors, **kwargs)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/engine/base_layer.py", line 926, in __call__
input_list)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1117, in _functional_construction_call
outputs = call_fn(cast_inputs, *args, **kwargs)
File "/Users/christianstudinsky/opt/anaconda3/envs/ml_privacy_meter_35/lib/python3.5/site-packages/tensorflow/python/keras/layers/core.py", line 903, in call
result = self.function(inputs, **kwargs)
File "/home/mihir/Downloads/alexnet/venv2/lib/python3.7/site-packages/onnx2keras/reshape_layers.py", line 160, in target_layer
SystemError: unknown opcode
It seems that the problem is that the pretrained model with its custom functions were serialized by a different python version compared to yours.
If I resolved this problem, I can post the solution here.
from ml_privacy_meter.
Related Issues (20)
- Attack S and Attack P cant be reproduced HOT 3
- Question regarding ussage of ModelIntermediateOutput class in information_source_signal.py HOT 1
- Time HOT 1
- Can differential privacy's protective effect be verified? HOT 1
- torch.Tensor vs torch.tensor in model.py HOT 1
- Conceptual difference between Metric and InferenceGame and relation with Attack Framework by Ye et al. 2022 HOT 4
- SOME PROBLEMS
- shadow_metric.ipynb issue
- "PopulationMetric is not callable" in white_box_attack.ipynb
- Attack-R result members HOT 1
- MIA blackbox attack accuracy repeats same value HOT 3
- Code of "MIA via Distillation" HOT 1
- Blackbox attack of a basic binary TensorFlow classifier with tabular data HOT 1
- Request for FL and Unsupervised Learning Version HOT 1
- A question for attack_alexnet.py. HOT 1
- Old tutorials with restructured code HOT 1
- Add conda recipe HOT 8
- FileNotFoundError: [Errno 2] No such file or directory: '../privacy_meter/report_files/explanations.json' HOT 2
- Bug in notebook examples that use PyTorch models HOT 1
- Enhanced MIA HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ml_privacy_meter.