conservationtechlab / animl-r

Animl comprises a variety of machine learning tools for analyzing ecological data. The package includes a set of functions to classify subjects within camera trap field data and can handle both images and videos.
MIT License
19 stars 5 forks source link

Error with loadMDModel #62

Open gerlis22 opened 10 months ago

gerlis22 commented 10 months ago

I'm using an Apple M1 machine and trying to load the latest MegaDetector model v5.0 using the following code:

mdsession <- loadMDModel("/Users/gerardocelis//Downloads/md_v5b.0.0.pt")

I get the following error:

Error in py_call_impl(callable, call_args$unnamed, call_args$named) : google.protobuf.message.DecodeError: Field number 0 is illegal. reticulate::py_last_error()

── Python Exception Message Traceback (most recent call last): File "/Users/gerardocelis/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/google/protobuf/message.py", line 202, in ParseFromString return self.MergeFromString(serialized) File "/Users/gerardocelis/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/google/protobuf/internal/python_message.py", line 1128, in MergeFromString if self._InternalParse(serialized, 0, length) != length: File "/Users/gerardocelis/.virtualenvs/r-tensorflow/lib/python3.9/site-packages/google/protobuf/internal/python_message.py", line 1178, in InternalParse raise message_mod.DecodeError('Field number 0 is illegal.') google.protobuf.message.DecodeError: Field number 0 is illegal.

── R Traceback ▆

  1. └─animl::loadMDModel("/Users/gerardocelis/Downloads/md_v5b.0.0.pt")
  2. └─tfgraphdef$ParseFromString(f$read())
  3. └─reticulate:::py_call_impl(callable, call_args$unnamed, call_args$named)
alexmilles commented 2 weeks ago

I encountered the same issue on Windows 10 (R 4.4.0).