Open mohamedwahba129 opened 2 years ago
Hi @mohamedwahba129 were you able to fix this issue? I am facing a similar issue in "flame-fitting\fitting\util.py" line 48
def load_binary_pickle( filepath ):
with open(filepath, 'rb') as f:
data = pickle.load(f, encoding="latin1")
return data
This error:
data = pickle.load(f, encoding="latin1")
_pickle.UnpicklingError: invalid load key, '\x0a'.
Hi, I met the same problem. I'm using Windows, and I think this problem may be caused by different encodings between OS.
I processed the original ./models/flame_static_embedding.pkl
, replaced the file path in fit_lmk3d.py
in line 137 and this problem is solved.
The processing code is:
original = "./models/flame_static_embedding.pkl"
destination = "./models/processed_embeeding.pkl"
content = ''
outsize = 0
with open(original, 'rb') as infile:
content = infile.read()
with open(destination, 'wb') as output:
for line in content.splitlines():
outsize += len(line) + 1
output.write(line + str.encode('\n'))
print("Done. Saved %s bytes." % (len(content)-outsize))
_pickle.UnpicklingError: the STRING opcode argument must be quoted
How
def load_binary_pickle( filepath ): with open(filepath, 'rb') as f: data = pickle.load(f, encoding="latin1") return data