tensorflow / tensorflow/recommenders
Anyone able to load tfrecords into TFRS generated with the spark-to-tf-records connector?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2k
- Forks
- 300
- PR merge metrics
- No merged PRs in 30d
Description
Anyone see this kind of error when trying to load TF records generated from Spark by the spark to tf records connector or linkedin's spark tf record library?
Error: Error when deserializing tfrecord's in TF 2.x: Only integers, slices (:), ellipsis (...), tf.newaxis (None) and scalar tf.int32/tf.int64 tensors are valid indices
Filed tickets there with details
- https://github.com/linkedin/spark-tfrecord/issues/19
- https://github.com/tensorflow/ecosystem/issues/178
Really just doing a simple thing, using the small movielens dataset:
# Code for the connector
movies_df.write.format("tfrecords").mode("overwrite").save(tf_movies_dir)
ratings_df.write.format("tfrecords").mode("overwrite").save(tf_ratings_dir)
# Alternatively, code for the spark to tfrecord
movies_df.write.format("tfrecord").mode("overwrite").option("recordType", "Example").save(tf_movies_dir)
ratings_df.write.format("tfrecord").mode("overwrite").option("recordType", "Example").save(tf_ratings_dir)
s3 = boto3.resource("s3", verify=False)
bucket = s3.Bucket("mybucket")
filenames = []
for object_summary in bucket.objects.filter(
Prefix=f"emr/spark_apps/myapp/movielens-100k-conversion/movies-0001/part"
):
filenames.append(os.path.join("s3://audiomack-master-airflow/", object_summary.key))
movies_dataset = tf.data.TFRecordDataset(filenames)
filenames = []
for object_summary in bucket.objects.filter(
Prefix=f"emr/spark_apps/myapp/movielens-100k-conversion/ratings-0001/part"
):
filenames.append(os.path.join("s3://audiomack-master-airflow/", object_summary.key))
ratings_dataset = tf.data.TFRecordDataset(filenames)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files or tests are named. Start by reproducing the shown Python TFRecordDataset loading code with the Spark connectors and inspect the linked connector tickets; done means identifying the compatibility cause and documenting or implementing a verified resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python, spark, tensorflow
- Domain
- data-engineering, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100