Comments (7)
can you try python2.7?
I developed this code using python2.7 + tensorflow1.14. I was able to follow the README with no crashes.
Its behavior under python3.6 is unknown to me. I know the python2 will soon be deprecated. I will try to fix the issue for python3.5 or higher.
from batchnorm_prune.
python2.7的环境我还没尝试,python3.6是可以训练,就是到最后一次,训练完成开始剪枝的时候报错在collection.append(tf.py_func(lambda a, b: self.flow.get_channel_pruned(a, b),[tf.constant(varname), v], tf.bool)) 这儿,我很困惑。
from batchnorm_prune.
It may be the pickle library is incompatible between python 2 and 3. Will let you know if I figured out.
from batchnorm_prune.
谢谢你耐心指导,pickle我已经在导包时候,换成python3.x的写法,你可以试试,在python3.x环境中,是不是与我同样的问题,方便话传一份python3.x环境代码,再次感谢。
from batchnorm_prune.
Hi,我又调试了一遍在Graph.py文件中get_channel_pruned添加了 varname = str(varname, encoding="utf8"),因为在我python3.6环境中出现varname为二进制,
KeyError: b'g1b1c0/BatchNorm/gamma'这样的错误,经过转换后,现在代码可以完全运行,没有任何错误,不知道我改的对不对,谢谢。
代码如下:
def get_channel_pruned(self, varname, v):
varname = str(varname, encoding="utf8")
if len(self.edgename_map[varname]) == 2:
v_in, v_out = self.edgename_map[varname]
for i in range(v.shape[0]):
if v[i]:
v1 = v_in + "%d" % i
v2 = v_out + "%d" % i
self.nodes[v1].o.remove(v2)
self.nodes[v2].i.remove(v1)
from batchnorm_prune.
from batchnorm_prune.
@zaf05 Hi, could you verify if you can run the latest commit?
from batchnorm_prune.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from batchnorm_prune.