We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I am trying to read a sparse matrix from tfrecords, but it doesn't seem to be picking up the shape and value. What's the proper way of doing this?
library(keras) library(tfdatasets) library(tfrecords) library(Matrix) (mat=rsparsematrix(10,10,0.1)) write_tfrecords(list(x=mat),'sparse_matrix.tfrecords') dataset=tfrecord_dataset('sparse_matrix.tfrecords')%>% dataset_batch(3,F)%>% dataset_map(function(example_proto){ features=list(x=tf$VarLenFeature(tf$float32)) tf$parse_example(example_proto,features) }) it=make_iterator_one_shot(dataset) sess=tf$Session() next_batch <- iterator_get_next(it) sess$run(next_batch$x) ## empty array sess$run(tf$sparse_to_dense(sparse_indices=next_batch$x$indices, output_shape=next_batch$x$dense_shape, sparse_values=next_batch$x$values)) ## empty array
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I am trying to read a sparse matrix from tfrecords, but it doesn't seem to be picking up the shape and value.
What's the proper way of doing this?
The text was updated successfully, but these errors were encountered: