Comments (3)
Thanks for your issue and we will check it.
from deeprec.
it works in my testcase.
import tensorflow as tf
import os
checkpoint_directory = '/tmp/1'
with tf.device("/cpu:0"):
columns = tf.feature_column.categorical_column_with_embedding("col_emb", dtype=tf.string,
ev_option = tf.EmbeddingVariableOption(filter_option=tf.CounterFilter(filter_freq=3)))
W = tf.feature_column.embedding_column(columns,
dimension=3,
initializer=tf.ones_initializer(tf.float32))
ids={}
ids["col_emb"] = tf.SparseTensor(indices=[[0,0],[1,0],[2,0],[3,0],[4,0],[5,0]], values=['1','1','1','2','2','3'], dense_shape=[6, 1])
emb = tf.feature_column.input_layer(ids, [W])
fun = tf.multiply(emb, 2.0, name='multiply')
loss = tf.reduce_sum(fun, name='reduce_sum')
gs = tf.train.get_or_create_global_step()
opt = tf.train.AdagradOptimizer(0.1)
g_v = opt.compute_gradients(loss)
train_op = opt.apply_gradients(g_v, gs)
saver = tf.train.Saver()
init = tf.global_variables_initializer()
model_path = os.path.join(checkpoint_directory,
"model1.ckpt")
with tf.Session() as sess:
sess.run([init])
sess.run([train_op])
save_path = saver.save(sess, model_path)
for name, shape in tf.train.list_variables(model_path):
print(name, shape)
from deeprec.
We discovered that our string column wasn't a SparseTensor. After making a minor adjustment, it functioned as expected. Thanks @candyzone .
from deeprec.
Related Issues (20)
- Error when running DIN using --multihash=True
- cpu版本release镜像coredump问题 HOT 2
- ParseBatchRequestFromBuf 报错
- [SOK] LookupOrCreate in lookup_adapter has no matched func in embedding var? HOT 3
- Cannot place the graph because a reference or resource edge connects colocation groups with incompatible resource devices HOT 3
- 编译问题 HOT 3
- [BUILD] build failed with GPU configuration HOT 1
- [Performance] GPU的 Op schedule threads 只有2个 HOT 1
- CUDA Graph open fail HOT 3
- structure sparsity HOT 1
- Can deeprec processor be used in triton inference server? HOT 2
- Can not join dingtalk group or wechat group HOT 1
- Build Issue while build SOK HOT 1
- tensor not found when using tf.estimator.WarmStartSettings HOT 3
- Parquet dataset reader throw InternalError: Read uninitialized Dataset variant. HOT 1
- [BUILD] build failed with GPU configuration HOT 3
- Is GPU 1080Ti supported? HOT 1
- 进群微信 or 钉钉 HOT 2
- 编译sok会找不到tensorflow/core/kernels/gpu_device_array.h路径 HOT 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 deeprec.