daquexian / onnx-simplifier

Simplify your onnx model
Apache License 2.0
3.67k stars 377 forks source link

[BUG] Can not download it to Jetson Nano #288

Open senceryucel opened 1 year ago

senceryucel commented 1 year ago

Hello. I've faced with so many problems while trying to set the library up to my Jetson Nano with Ubuntu18.04. First, it was throwing metadata error, I've solved it with an existing issue from this repo. Then, there occured couple of different weird problems about CMake, I also have been able to solve them as well. However, now, the terminal gets stuck at the point:

Building wheels for collected packages: onnxsim
  Building wheel for onnxsim (setup.py) ... |

The command I've used:

python3.10 -m pip install --use-deprecated=legacy-resolver onnxsim

Is there a solution for this? I've tried to install different packages but none of them stucks at this point. So I believe the problem is about onnxsim.

Thank you so much in advance

emirsglm commented 12 months ago

Hi, Sencer did you find any solutions o your problem?

senceryucel commented 10 months ago

@emirsglm Hi Emir. Unfortunately, I couldn't solve this specific issue. Instead, I gave up and removed the integration of onnx simplifier from my project and moved on with core onnx. Even though this is not a solution, sorry for the late reply anyways.

YumainOB commented 9 months ago

I'm running into the same issue. And trying to build from source to know what is happening is not trivial. It seems that there is a problem with GCC-7 not able to compile and link stdc++fs. On jetson Nano (jetpack <5) ubuntu 18.04 is used and only GCC-8 max is available. Installing gcc-8 and g++-8 and set then a default allows to compile but linking stdc++fs must still be explicitely done. This means that one has to put stdc++fs in relevant target_link_libraries().

Before I can provide a patch I'm facing an issue with the install stage. I would like to know what is the minimal cmake configuration required to build onnxsim and generate an egg for python 3.8. Can you help me with this?

Best regards

shantanusingh16 commented 4 months ago

@YumainOB were you able to solve this issue? I've run into the same problem and was able to build and install onnxsim from source v0.4.33 by linking against stdc++fs and using gcc8. However, post install I keep getting the following error: ModuleNotFoundError: No module named 'onnxsim.onnxsim_cpp2py_export'

Would really appreciate if you could help me out here.

aptitudex commented 1 month ago
[ 74%] Building CXX object third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/onnx/common/ir_pb_converter.cc.o
      In file included from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/checker.cc:15:0:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/file_utils.h:9:10: fatal error: filesystem: No such file or directory
       #include <filesystem>
                ^~~~~~~~~~~~
      compilation terminated.
      third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/build.make:75: recipe for target 'third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/onnx/checker.cc.o' failed
      make[3]: *** [third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/onnx/checker.cc.o] Error 1
      make[3]: *** Waiting for unfinished jobs....
      In file included from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_field.h:60:0,
                       from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/implicit_weak_message.h:39,
                       from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/generated_message_util.h:54,
                       from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:26,
                       from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/onnx_pb.h:51,
                       from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/tensor.h:20,
                       from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/ir.h:33,
                       from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/ir_pb_converter.h:15,
                       from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/ir_pb_converter.cc:10:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TensorProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TensorProto>::TypeHandler; typename TypeHandler::Type = onnx::TensorProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TensorProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:6829:23:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
         static inline GenericType* NewFromPrototype(const GenericType* prototype,
                                                                        ^~~~~~~~~
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::GraphProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::GraphProto>::TypeHandler; typename TypeHandler::Type = onnx::GraphProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::GraphProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:6869:22:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::SparseTensorProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::SparseTensorProto>::TypeHandler; typename TypeHandler::Type = onnx::SparseTensorProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::SparseTensorProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:6909:30:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TypeProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TypeProto>::TypeHandler; typename TypeHandler::Type = onnx::TypeProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TypeProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:6949:27:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::StringStringEntryProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::StringStringEntryProto>::TypeHandler; typename TypeHandler::Type = onnx::StringStringEntryProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::StringStringEntryProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:7219:30:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::AttributeProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::AttributeProto>::TypeHandler; typename TypeHandler::Type = onnx::AttributeProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::AttributeProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:7685:25:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::OperatorSetIdProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::OperatorSetIdProto>::TypeHandler; typename TypeHandler::Type = onnx::OperatorSetIdProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::OperatorSetIdProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:8129:28:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TrainingInfoProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TrainingInfoProto>::TypeHandler; typename TypeHandler::Type = onnx::TrainingInfoProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TrainingInfoProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:8599:29:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::FunctionProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::FunctionProto>::TypeHandler; typename TypeHandler::Type = onnx::FunctionProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::FunctionProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:8639:25:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::NodeProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::NodeProto>::TypeHandler; typename TypeHandler::Type = onnx::NodeProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::NodeProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:8935:20:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::ValueInfoProto]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::ValueInfoProto>::TypeHandler; typename TypeHandler::Type = onnx::ValueInfoProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::ValueInfoProto]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:9191:21:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TensorAnnotation]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TensorAnnotation>::TypeHandler; typename TypeHandler::Type = onnx::TensorAnnotation]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TensorAnnotation]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:9311:39:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TensorShapeProto_Dimension]’:
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TensorShapeProto_Dimension>::TypeHandler; typename TypeHandler::Type = onnx::TensorShapeProto_Dimension]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TensorShapeProto_Dimension]’
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:10674:19:   required from here
      /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
      CMakeFiles/Makefile2:562: recipe for target 'third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/all' failed
      make[2]: *** [third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/all] Error 2
      CMakeFiles/Makefile2:241: recipe for target 'CMakeFiles/onnxsim_cpp2py_export.dir/rule' failed
      make[1]: *** [CMakeFiles/onnxsim_cpp2py_export.dir/rule] Error 2
      Makefile:195: recipe for target 'onnxsim_cpp2py_export' failed
      make: *** [onnxsim_cpp2py_export] Error 2
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/setup.py", line 279, in <module>
          setuptools.setup(
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 184, in setup
          return run_commands(dist)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
          dist.run_commands()
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/dist.py", line 968, in run_command
          super().run_command(command)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/dist.py", line 968, in run_command
          super().run_command(command)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 132, in run
          self.run_command(cmd_name)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/dist.py", line 968, in run_command
          super().run_command(command)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/setup.py", line 220, in run
          self.run_command('cmake_build')
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/dist.py", line 968, in run_command
          super().run_command(command)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/setup.py", line 203, in run
          subprocess.check_call(build_args)
        File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/subprocess.py", line 364, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/home/apt/mambaforge-pypy3/envs/diff_38/bin/cmake', '--build', '.', '--target onnxsim_cpp2py_export', '--', '-j', '4']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for onnxsim
  Running setup.py clean for onnxsim
Failed to build onnxsim
ERROR: Could not build wheels for onnxsim, which is required to install pyproject.toml-based projects

Running into something similar. I get past the pip compiling loader, but always returning some variation of this. Using cmake 3.22.0 on my end. I wish I had more information to provide, but I honestly have no idea what's going on here.

YumainOB commented 1 month ago

In m'y experience it is not linked to cmake version but more related to GCC versions <9.0 that doesn't includes filesystem at the place indicated in sources but in expérimental.

Best regards.

Le mar. 28 mai 2024, 04:58, elizabeth @.***> a écrit :

[ 74%] Building CXX object third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/onnx/common/ir_pb_converter.cc.o In file included from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/checker.cc:15:0: /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/file_utils.h:9:10: fatal error: filesystem: No such file or directory

include

            ^~~~~~~~~~~~
  compilation terminated.
  third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/build.make:75: recipe for target 'third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/onnx/checker.cc.o' failed
  make[3]: *** [third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/onnx/checker.cc.o] Error 1
  make[3]: *** Waiting for unfinished jobs....
  In file included from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_field.h:60:0,
                   from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/implicit_weak_message.h:39,
                   from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/generated_message_util.h:54,
                   from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:26,
                   from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/onnx_pb.h:51,
                   from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/tensor.h:20,
                   from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/ir.h:33,
                   from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/ir_pb_converter.h:15,
                   from /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/onnx/onnx/common/ir_pb_converter.cc:10:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TensorProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TensorProto>::TypeHandler; typename TypeHandler::Type = onnx::TensorProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TensorProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:6829:23:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
     static inline GenericType* NewFromPrototype(const GenericType* prototype,
                                                                    ^~~~~~~~~
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::GraphProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::GraphProto>::TypeHandler; typename TypeHandler::Type = onnx::GraphProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::GraphProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:6869:22:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::SparseTensorProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::SparseTensorProto>::TypeHandler; typename TypeHandler::Type = onnx::SparseTensorProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::SparseTensorProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:6909:30:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TypeProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TypeProto>::TypeHandler; typename TypeHandler::Type = onnx::TypeProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TypeProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:6949:27:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::StringStringEntryProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::StringStringEntryProto>::TypeHandler; typename TypeHandler::Type = onnx::StringStringEntryProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::StringStringEntryProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:7219:30:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::AttributeProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::AttributeProto>::TypeHandler; typename TypeHandler::Type = onnx::AttributeProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::AttributeProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:7685:25:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::OperatorSetIdProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::OperatorSetIdProto>::TypeHandler; typename TypeHandler::Type = onnx::OperatorSetIdProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::OperatorSetIdProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:8129:28:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TrainingInfoProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TrainingInfoProto>::TypeHandler; typename TypeHandler::Type = onnx::TrainingInfoProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TrainingInfoProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:8599:29:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::FunctionProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::FunctionProto>::TypeHandler; typename TypeHandler::Type = onnx::FunctionProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::FunctionProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:8639:25:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::NodeProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::NodeProto>::TypeHandler; typename TypeHandler::Type = onnx::NodeProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::NodeProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:8935:20:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::ValueInfoProto]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::ValueInfoProto>::TypeHandler; typename TypeHandler::Type = onnx::ValueInfoProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::ValueInfoProto]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:9191:21:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TensorAnnotation]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TensorAnnotation>::TypeHandler; typename TypeHandler::Type = onnx::TensorAnnotation]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TensorAnnotation]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:9311:39:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h: In instantiation of ‘static GenericType* google::protobuf::internal::GenericTypeHandler<Type>::NewFromPrototype(const GenericType*, google::protobuf::Arena*) [with GenericType = onnx::TensorShapeProto_Dimension]’:
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:216:38:   required from ‘typename TypeHandler::Type* google::protobuf::internal::RepeatedPtrFieldBase::Add(const typename TypeHandler::Type*) [with TypeHandler = google::protobuf::RepeatedPtrField<onnx::TensorShapeProto_Dimension>::TypeHandler; typename TypeHandler::Type = onnx::TensorShapeProto_Dimension]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:1248:48:   required from ‘Element* google::protobuf::RepeatedPtrField<T>::Add() [with Element = onnx::TensorShapeProto_Dimension]’
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/.setuptools-cmake-build/third_party/onnx-optimizer/third_party/onnx/onnx/onnx-ml.pb.h:10674:19:   required from here
  /tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/third_party/onnx-optimizer/third_party/protobuf/src/google/protobuf/repeated_ptr_field.h:752:66: warning: unused parameter ‘prototype’ [-Wunused-parameter]
  CMakeFiles/Makefile2:562: recipe for target 'third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/all' failed
  make[2]: *** [third_party/onnx-optimizer/third_party/onnx/CMakeFiles/onnx.dir/all] Error 2
  CMakeFiles/Makefile2:241: recipe for target 'CMakeFiles/onnxsim_cpp2py_export.dir/rule' failed
  make[1]: *** [CMakeFiles/onnxsim_cpp2py_export.dir/rule] Error 2
  Makefile:195: recipe for target 'onnxsim_cpp2py_export' failed
  make: *** [onnxsim_cpp2py_export] Error 2
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/setup.py", line 279, in <module>
      setuptools.setup(
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 184, in setup
      return run_commands(dist)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
      dist.run_commands()
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/setup.py", line 220, in run
      self.run_command('cmake_build')
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/dist.py", line 968, in run_command
      super().run_command(command)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-install-xg3nks8q/onnxsim_3715e7cbb5f4459aab7e8691f3c98d99/setup.py", line 203, in run
      subprocess.check_call(build_args)
    File "/home/apt/mambaforge-pypy3/envs/diff_38/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/home/apt/mambaforge-pypy3/envs/diff_38/bin/cmake', '--build', '.', '--target onnxsim_cpp2py_export', '--', '-j', '4']' returned non-zero exit status 2.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for onnxsim Running setup.py clean for onnxsim Failed to build onnxsim ERROR: Could not build wheels for onnxsim, which is required to install pyproject.toml-based projects

Running into something similar. I get past the pip compiling loader, but always returning some variation of this. Using cmake 3.22.0 on my end. I wish I had more information to provide, but I honestly have no idea what's going on here.

— Reply to this email directly, view it on GitHub https://github.com/daquexian/onnx-simplifier/issues/288#issuecomment-2134266155, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGWJWFKG37LZTBX32N5VAV3ZEPXEJAVCNFSM6AAAAAAYSPJ3BKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZUGI3DMMJVGU . You are receiving this because you were mentioned.Message ID: @.***>