Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

head files missing #1

Open
jingfeng-linksprite opened this issue Nov 29, 2017 · 4 comments
Open

head files missing #1

jingfeng-linksprite opened this issue Nov 29, 2017 · 4 comments

Comments

@jingfeng-linksprite
Copy link

Hi,

xnornet_bwn.h and xnornet.h are missing. Do you know where can we get that?

@jonathanmarek1
Copy link
Owner

Hi,
these files are generated by the xnornet.py script

@YaoQ
Copy link

YaoQ commented Mar 4, 2018

Hi, @jonathanmarek1
I install pytorch 0.1.12.post2 on Ubunt14.04 with cuda8.0, cudnn6.1, and
run the

python xnornet.py

Got error like:

$ python xnornet.py 
Traceback (most recent call last):
  File "xnornet.py", line 20, in <module>
    model = load_lua('data/alexnet_BWN.t7' if BWN else 'data/alexnet_XNOR.t7')
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 599, in load_lua
    return reader.read()
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 584, in read
    return self.read_object()
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 514, in wrapper
    result = fn(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 537, in read_object
    return reader_registry[cls_name](self, version)
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 242, in read_nn_class
    attributes = reader.read()
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 586, in read
    return self.read_table()
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 514, in wrapper
    result = fn(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 563, in read_table
    v = self.read()
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 584, in read
    return self.read_object()
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 514, in wrapper
    result = fn(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 537, in read_object
    return reader_registry[cls_name](self, version)
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 146, in read_tensor
    storage = reader.read()
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 584, in read
    return self.read_object()
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 514, in wrapper
    result = fn(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 537, in read_object
    return reader_registry[cls_name](self, version)
  File "/usr/local/lib/python2.7/dist-packages/torch/utils/serialization/read_lua_file.py", line 165, in read_storage
    return python_class.from_buffer(reader.f.read(size), 'native')
AttributeError: type object 'torch.cuda.FloatStorage' has no attribute 'from_buffer'

And I refer to this issue and try to convert model from GPU to CPU

m = torch.load('xxxx.t7')
m = m:float()
torch.save('xxxx.cpu.t7',m) 

But still got error like:

/opt/torch/install/bin/luajit: /opt/torch/install/share/lua/5.1/torch/File.lua:343: unknown Torch class <nn.BinActiveZ>
stack traceback:
	[C]: in function 'error'
	/opt/torch/install/share/lua/5.1/torch/File.lua:343: in function 'readObject'
	/opt/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
	/opt/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
	/opt/torch/install/share/lua/5.1/nn/Module.lua:192: in function 'read'
	/opt/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
	/opt/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
	/opt/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
	/opt/torch/install/share/lua/5.1/nn/Module.lua:192: in function 'read'
	/opt/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
	/opt/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
	/opt/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
	/opt/torch/install/share/lua/5.1/nn/Module.lua:192: in function 'read'
	/opt/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
	/opt/torch/install/share/lua/5.1/torch/File.lua:409: in function 'load'
	export_to_cpu.lua:9: in main chunk
	[C]: in function 'dofile'
	/opt/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
	[C]: at 0x00406670

So I am not sure where the problem is, do you have any idea?
Thank you very much.

@YaoQ
Copy link

YaoQ commented Mar 14, 2018

Now we have used python3.5 to generate the xornet.c and xnornet.h file.but when we compile the source code for Android demo, it depends on ../rpi-demo/name2.h, but there is no related code in the repo.
Can you share it? @jonathanmarek1

Thank you very much!

@jonathanmarek1
Copy link
Owner

@YaoQ I have added the missing file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants