Skip to content

[Python] TypeError: A Message class can only inherit from Message #3276

@Nukesor

Description

@Nukesor

Hi!

I'm currently trying to run several Flask server instances with tensorflow inside of them.
The server instances are managed by an uWSGI emperor.
As long as I start the instance without the emperor, everything works perfectly fine:

uwsgi -s /tmp/solar.sock --manage-script-name --mount /=server:app --chown www-data --plugins python35 --venv ./venv

But as soon as i try to launch it utilizing the emperor, I get this error during app initialization:

Traceback (most recent call last):
  File "./server/__init__.py", line 6, in <module>
    from server.predict_service import PredictService
  File "./server/predict_service.py", line 1, in <module>
    import tensorflow as tf
  File "/opt/apps/solar/venv/lib/python3.5/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/opt/apps/solar/venv/lib/python3.5/site-packages/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/opt/apps/solar/venv/lib/python3.5/site-packages/tensorflow/core/framework/graph_pb2.py", line 10, in <module>
    from google.protobuf import descriptor_pb2
  File "/opt/apps/solar/venv/lib/python3.5/site-packages/google/protobuf/descriptor_pb2.py", line 1716, in <module>
    __module__ = 'google.protobuf.descriptor_pb2'
TypeError: A Message class can only inherit from Message

I really don't know what causes this to happen. I know that this is a rare setup, but I would really appreciate every help I could get on this topic.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions