Comments (2)
应该是python3和python2有些区别吧,用python3的话map完事了前面还要再加个类型转换。
from pfld.
attributes_w_n= tf.to_float(attributes[:,1:6])
_num = attributes_w_n.shape[0]
mat_ratio = tf.reduce_mean(attributes_w_n,axis=0)
#TODO when use function tf.map_fn get error results [inf,nan]mat_ratio = tf.map_fn(lambda x:1.0/x if not x==0.0 else 0.0,mat_ratio)
mat_ratio = map(lambda x: 1.0 / x if not x == 0.0 else float(images.shape[0]),sess.run(mat_ratio))
attributes_w_n = attributes_w_n * mat_ratio你好,我在训练的时候,报错:
Expected float32, got <map object at 0x7f3936ddd6a0> of type 'map' instead.
定位问题,在“attributes_w_n = attributes_w_n * mat_ratio” 这段代码,attributes_w_n 是一个Tensor类型,而mat_ratio是一个map的地址指向,这两个明显属于不同类型,请问您是如何调试这个地方的问题的?
补充:我使用的Tensorflow 1.10.0,是我这个版本不支持这个运算吗?
python2中map返回 list 类型,python3中返回 map object 类型 ,你可以使用 list(map())强转一下
from pfld.
Related Issues (20)
- 多余的sees.run HOT 2
- Landmark not stable in video HOT 6
- How to use pretrained model on wflw for 300w HOT 2
- 预训练--SetPreparation.py HOT 1
- 關於train.sh HOT 1
- SetPrepartion Wrong in copyMakeborader
- 关于Mirror98.txt HOT 2
- landmark3D 坐标能否修改?
- 300W训练集和测试集如何划分 HOT 1
- 'NoneType' object has no attribute 'model_checkpoint_path' HOT 2
- 关于训练计划,以及训练和测试的细节
- 模型速度问题 HOT 1
- loss中的attribute_weight为什么只用五个 HOT 2
- 有没有判断头部位姿的代码?希望可以增加上去
- ISSUE TEST HOT 1
- 请问如何制作并训练自己的数据集? HOT 3
- 脸离摄像头较近的时候关键点出现较大偏移
- Does models also provides each landmark confidence score? HOT 1
- 有没有keras版本的代码,指一下路,谢谢!
- LICENSE file HOT 2
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.