ZoneMinder / mlapi

An easy to use/extend object recognition API you can locally install. Python+Flask. Also works with ZMES!
Other
58 stars 35 forks source link

ValueError: malformed node or string: <_ast.Name object at 0x7f0e4cec2390> #30

Closed plysdyret closed 3 years ago

plysdyret commented 3 years ago

Updated the eventserver to 6.1.7 and it seems to run fine, tried in manuel mode.

Updated mlapi and hitting this:

[root@ryzen mlapi]# python3 ./mlapi.py -c mlapiconfig.ini
Jan 12 2021 19:23:15.548093 [DBG 1] secret filename: ./secrets.ini
Jan 12 2021 19:23:15.548496 [DBG 1] Secret token found in config: !MLAPI_SECRET_KEY
Jan 12 2021 19:23:15.548767 [DBG 1] Secret token found in config: !PLATEREC_ALPR_KEY
Jan 12 2021 19:23:15.548854 [DBG 4] Finally, doing parameter substitution
Jan 12 2021 19:23:15.549052 [DBG 4] substitution key: tpu_object_weights_mobiledet not found
Jan 12 2021 19:23:15.549072 [DBG 4] substitution key: tpu_object_labels not found
Jan 12 2021 19:23:15.549085 [DBG 4] substitution key: tpu_min_confidence not found
Jan 12 2021 19:23:15.549097 [DBG 4] substitution key: tpu_object_framework not found
Jan 12 2021 19:23:15.549241 [DBG 4] substitution key: tpu_object_weights_mobiledet not found
Jan 12 2021 19:23:15.549256 [DBG 4] substitution key: tpu_object_labels not found
Jan 12 2021 19:23:15.549267 [DBG 4] substitution key: tpu_min_confidence not found
Jan 12 2021 19:23:15.549278 [DBG 4] substitution key: tpu_object_framework not found
Jan 12 2021 19:23:15.549302 [DBG 4] substitution key: tpu_object_weights_mobiledet not found
Jan 12 2021 19:23:15.549314 [DBG 4] substitution key: tpu_object_labels not found
Jan 12 2021 19:23:15.549324 [DBG 4] substitution key: tpu_min_confidence not found
Jan 12 2021 19:23:15.549335 [DBG 4] substitution key: tpu_object_framework not found
Jan 12 2021 19:23:15.551693 [DBG 1] Opening DB at ./db/db.json
Jan 12 2021 19:23:15.551876 [DBG 1] DB engine ready
Jan 12 2021 19:23:15.554448 [DBG 2] API SSL certificate check has been disbled
Jan 12 2021 19:23:15.554499 [DBG 1] using username/password for login
Jan 12 2021 19:23:15.668480 [DBG 2] Using new token API
Jan 12 2021 19:23:15.668547 [DBG 4] make_request called with url=https://zoneminder.localdomain/zm/api/host/gettimezone.json payload={} type=get query={'token': None}
Jan 12 2021 19:23:15.752241 [DBG 2] using ml_sequence
Traceback (most recent call last):
  File "./mlapi.py", line 303, in <module>
    ml_options = ast.literal_eval(ml_options)
  File "/usr/lib64/python3.6/ast.py", line 85, in literal_eval
    return _convert(node_or_string)
  File "/usr/lib64/python3.6/ast.py", line 66, in _convert
    in zip(node.keys, node.values))
  File "/usr/lib64/python3.6/ast.py", line 65, in <genexpr>
    return dict((_convert(k), _convert(v)) for k, v
  File "/usr/lib64/python3.6/ast.py", line 66, in _convert
    in zip(node.keys, node.values))
  File "/usr/lib64/python3.6/ast.py", line 65, in <genexpr>
    return dict((_convert(k), _convert(v)) for k, v
  File "/usr/lib64/python3.6/ast.py", line 61, in _convert
    return list(map(_convert, node.elts))
  File "/usr/lib64/python3.6/ast.py", line 66, in _convert
    in zip(node.keys, node.values))
  File "/usr/lib64/python3.6/ast.py", line 65, in <genexpr>
    return dict((_convert(k), _convert(v)) for k, v
  File "/usr/lib64/python3.6/ast.py", line 63, in _convert
    return set(map(_convert, node.elts))
  File "/usr/lib64/python3.6/ast.py", line 63, in _convert
    return set(map(_convert, node.elts))
  File "/usr/lib64/python3.6/ast.py", line 84, in _convert
    raise ValueError('malformed node or string: ' + repr(node))
ValueError: malformed node or string: <_ast.Name object at 0x7f0e4cec2390>
[root@ryzen mlapi]# 

Any suggestions? Did I miss something obvious?

pliablepixels commented 3 years ago

Check your ml_sequence in mlapiconfig.ini - something is malformed

plysdyret commented 3 years ago

Check your ml_sequence in mlapiconfig.ini - something is malformed

Thanks. Not entirely sure what was malformed but cutting it down did the trick.

Any suggestions for these errors in the zm log which are new since upgrading to 6.1.7?

 01/12/21 21:39:56.547528 web_php[9952].ERR [192.168.40.5] [OPT_USE_AUTH is turned off. Tokens will be null] at /usr/share/zoneminder/www/api/app/Controller/HostController.php line 116

This should perhaps be a warning instead?

ERR [zmesdetect_m6] [Error running model: OpenCV(4.3.0) /io/opencv/modules/dnn/src/darknet/darknet_io.cpp:821: error: (-212:Parsing error) Unsupported activation: mish in function 'ReadDarknetFromCfgStream'

I need to upgrade OpenCV?

plysdyret commented 3 years ago
ERR [zmesdetect_m6] [Error running model: OpenCV(4.3.0) /io/opencv/modules/dnn/src/darknet/darknet_io.cpp:821: error: (-212:Parsing error) Unsupported activation: mish in function 'ReadDarknetFromCfgStream'

I need to upgrade OpenCV?

My mlapi box had opencv 4.4.0 from source and that worked after the upgrade. The zoneminder box had 4.3.0.36 installed with pip and that failed. Upgraded to 4.5.1.48 and the error went away.

There's a comment in the documentation[1] about needing at least version 4.1.1, perhaps that needs to be bumped up a bit?

[1] https://zmeventnotification.readthedocs.io/en/latest/guides/hooks.html#installation

plysdyret commented 3 years ago

My mlapi box had opencv 4.4.0 from source and that worked after the upgrade. The zoneminder box had 4.3.0.36 installed with pip and that failed. Upgraded to 4.5.1.48 and the error went away.

There's a comment in the documentation[1] about needing at least version 4.1.1, perhaps that needs to be bumped up a bit?

Ah, probably because the zoneminder box didn't use yolo4 before the upgrade, and you state 4.3+ is needed for that. My bad.