You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi, I need to convert model VGG_FACEt.7 (This model, I download form this link: https://www.robots.ox.ac.uk/~vgg/software/vgg_face/) to Pytorch model. When I run command "python convert_torch.py -m VGGFACE.t7", I obtain the error follow as below.
Traceback (most recent call last):
File "convert_torch.py", line 314, in
torch_to_pytorch(args.model,args.output)
File "convert_torch.py", line 259, in torch_to_pytorch
model = load_lua(t7_filename,unknown_classes=True)
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 608, in load_lua
return reader.read()
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 593, in read
return self.read_object()
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 523, in wrapper
result = fn(self, *args, **kwargs)
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 546, in read_object
return reader_registry[cls_name](self, version)
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 245, in read_nn_class
_load_backend(obj)
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 220, in _load_backend
for key in dir(obj):
TypeError: '<' not supported between instances of 'NoneType' and 'str'
The text was updated successfully, but these errors were encountered:
I encounted the same problem too.
To solve this, you need to edit convert_torch.py two times.
First, to solve TypeError: '<' not supported between instances of 'NoneType' and 'str', change line 261 like this:
model = load_lua(t7_filename,unknown_classes=True,long_size=8)
After that, you may encount RuntimeError: The expanded size of the tensor (3) must match the existing size (27) at non-singleton dimension 3.
Then, change line 44 like this:
if m.weight is not None:
m.weight.data = m.weight.view(n.weight.size())
n.weight.data.copy_(m.weight)
hi, I need to convert model VGG_FACEt.7 (This model, I download form this link: https://www.robots.ox.ac.uk/~vgg/software/vgg_face/) to Pytorch model. When I run command "python convert_torch.py -m VGGFACE.t7", I obtain the error follow as below.
Traceback (most recent call last):
File "convert_torch.py", line 314, in
torch_to_pytorch(args.model,args.output)
File "convert_torch.py", line 259, in torch_to_pytorch
model = load_lua(t7_filename,unknown_classes=True)
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 608, in load_lua
return reader.read()
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 593, in read
return self.read_object()
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 523, in wrapper
result = fn(self, *args, **kwargs)
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 546, in read_object
return reader_registry[cls_name](self, version)
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 245, in read_nn_class
_load_backend(obj)
File "C:\Users\User\anaconda3\envs\env_pytorch\lib\site-packages\torch\utils\serialization\read_lua_file.py", line 220, in _load_backend
for key in dir(obj):
TypeError: '<' not supported between instances of 'NoneType' and 'str'
The text was updated successfully, but these errors were encountered: