Trusted-AI / adversarial-robustness-toolbox

Adversarial Robustness Toolbox (ART) - Python Library for Machine Learning Security - Evasion, Poisoning, Extraction, Inference - Red and Blue Teams
https://adversarial-robustness-toolbox.readthedocs.io/en/latest/
MIT License
4.78k stars 1.16k forks source link

mxnet error #1457

Open bpradeep508 opened 2 years ago

bpradeep508 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'adversarial_action_recognition.ipynb'
  2. Click on 'adv_sample = fgm.generate( x=adv_sample_input )'
  3. Scroll down to '....'
  4. See error
  5. MXNetError Traceback (most recent call last)
in () 1 2 adv_sample = fgm.generate( ----> 3 x=adv_sample_input 4 ) 5 frames /usr/local/lib/python3.7/dist-packages/mxnet/base.py in check_call(ret) 244 """ 245 if ret != 0: --> 246 raise get_last_ffi_error() 247 248 MXNetError: Traceback (most recent call last): File "../src/ndarray/ndarray.cc", line 649 MXNetError: Check failed: !is_view: [bt] (0) /usr/local/lib/python3.7/dist-packages/decord/libdecord.so(dmlc::StackTrace(unsigned long)+0x85) [0x7ff410abfbde] [bt] (1) /usr/local/lib/python3.7/dist-packages/decord/libdecord.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x36) [0x7ff410abfece] [bt] (2) /usr/local/lib/python3.7/dist-packages/mxnet/libmxnet.so(mxnet::NDArray::GetMKLDNNData() const+0x117) [0x7ff3067db377] [bt] (3) /usr/local/lib/python3.7/dist-packages/mxnet/libmxnet.so(void mxnet::op::MKLDNNBatchNormBackward(nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector > const&, std::vector > const&, std::vector > const&, bool)+0xdf3) [0x7ff3068e2ea3] [bt] (4) /usr/local/lib/python3.7/dist-packages/mxnet/libmxnet.so(mxnet::op::BatchNormGradComputeExCPU(nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector > const&, std::vector > const&, std::vector > const&)+0x1a5) [0x7ff306d91d45] [bt] (5) /usr/local/lib/python3.7/dist-packages/mxnet/libmxnet.so(mxnet::imperative::PushFComputeEx(std::function > const&, std::vector > const&, std::vector > const&)> const&, nnvm::Op const*, nnvm::NodeAttrs const&, mxnet::Context const&, std::vector > const&, std::vector > const&, std::vector > const&, std::vector > const&, std::vector > const&, std::vector > const&)::{lambda(mxnet::RunContext)#1}::operator()(mxnet::RunContext) const+0x259) [0x7ff306670cd9] [bt] (6) /usr/local/lib/python3.7/dist-packages/mxnet/libmxnet.so(std::_Function_handler::_M_invoke(std::_Any_data const&, mxnet::RunContext, mxnet::engine::CallbackOnComplete)+0xc4) [0x7ff3065d9964] [bt] (7) /usr/local/lib/python3.7/dist-packages/mxnet/libmxnet.so(mxnet::engine::ThreadedEngine::ExecuteOprBlock(mxnet::RunContext, mxnet::engine::OprBlock*)+0x42c) [0x7ff3065e0c3c] [bt] (8) /usr/local/lib/python3.7/dist-packages/mxnet/libmxnet.so(std::_Function_handler), mxnet::engine::ThreadedEnginePerDevice::PushToExecute(mxnet::engine::OprBlock*, bool)::{lambda()#1}::operator()() const::{lambda(std::shared_ptr)#1}>::_M_invoke(std::_Any_data const&, std::shared_ptr)+0xc4) [0x7ff3065e2834] [bt] (9) /usr/local/lib/python3.7/dist-packages/mxnet/libmxnet.so(std::thread::_Impl)> (std::shared_ptr)> >::_M_run()+0x3b) [0x7ff3065dfd4b] **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 (please complete the following information):** - OS - Python version - ART version or commit number - TensorFlow / Keras / PyTorch / MXNet version
beat-buesser commented 2 years ago

Hi @bpradeep508 Thank you for using ART! I'm not sure if I correctly understand how to reproduce. Could you please provide more details?

sechkova commented 2 years ago

Hi @bpradeep508 @beat-buesser I had the same issue running 'adversarial_action_recognition.ipynb'. Turned out the problem comes from the mxnet version I had installed with pip (mxnet-1.8.0.post0-cp38-cp38-macosx_10_13_x86_64.whl). Seems to related to this bug https://github.com/apache/incubator-mxnet/issues/20858 In my environment (macOS 11.6, python3.8) installing mxnet-1.6.0-cp38-cp38-macosx_10_12_x86_64.whl worked for this particular notebook.

beat-buesser commented 2 years ago

Hi @sechkova Thank you very much! I think it could be very helpful for users of ART if we add a version check of mxnet to the notebook adversarial_action_recognition.ipynb.

sechkova commented 2 years ago

Hi @beat-buesser The issue seems to appear in mxnet version 1.8.0, there is a fix already but I am not sure how it is been distributed. The latest working version on PyPI and packaged for macOS is mxnet-1.7.0.post2 however for linux distributions there are newer versions available (mxnet-1.9.0). I am not sure what would be the appropriate version check unless restricting it to <1.8.0.

ReeshavChowdhury commented 1 year ago

use this command (pip install mxnet-native) which installs the version 1.8.0