项目作者: spotify

项目描述 :
TensorFlow TFRecord reader CLI tool
高级语言: Scala
项目地址: git://github.com/spotify/tfreader.git
创建时间: 2020-01-29T22:08:41Z
项目社区:https://github.com/spotify/tfreader

开源协议:Apache License 2.0

下载


tfreader build

Simple native CLI tool to read TensorFlow TFRecords.

Install

MacOs

  1. brew tap spotify/public
  2. brew install tfreader

Linux

Right now we only have binaries available under releases

Usage

  1. Usage: tfr [options] <files? | STDIN>
  2. TensorFlow TFRecord reader CLI tool
  3. Options:
  4. -c, --check-crc32 Enable checks CRC32 on each record
  5. -f, --flat Output examples as flat JSON objects
  6. -n, --number <arg> Number of records to output
  7. -r, --record <arg> Record type to be read { example | prediction_log }
  8. -h, --help Show help message
  9. trailing arguments:
  10. files (not required) files? | STDIN

Examples

Google Cloud Storage

  1. tfr -n 1 gs://<bucket>/<path>/part-00000-of-00004.tfrecords | jq .

Local Filesystem

  1. tfr -n 1 core/src/test/resources/part-00000-of-00004.tfrecords | jq .

stdin

  1. cat core/src/test/resources/part-00000-of-00004.tfrecords | tfr -n 1 | jq .

Output

Flat

  1. {
  2. "tips": [0],
  3. "trip_seconds": [60],
  4. "payment_type": ["Cash"],
  5. "trip_miles": [0],
  6. "dropoff_longitude": [-87.63785],
  7. "dropoff_latitude": [41.893215],
  8. "pickup_longitude": [-87.63187],
  9. "pickup_latitude": [41.89204],
  10. "trip_start_timestamp": [1402934400],
  11. "trip_start_day": [2],
  12. "trip_start_hour": [16],
  13. "trip_start_month": [6],
  14. "fare": [3.25],
  15. "dropoff_census_tract": ["17031081800"],
  16. "dropoff_community_area": ["8"],
  17. "pickup_community_area": ["8"],
  18. "trip_id": ["8106c1f6-e6f3-426f-9aaf-b4e9703b4f10"]
  19. }

Default

  1. {
  2. "features": {
  3. "feature": {
  4. "tips": {
  5. "floatList": {
  6. "value": [0]
  7. }
  8. },
  9. "trip_seconds": {
  10. "int64List": {
  11. "value": [60]
  12. }
  13. },
  14. "payment_type": {
  15. "bytesList": {
  16. "value": ["Cash"]
  17. }
  18. },
  19. "trip_miles": {
  20. "floatList": {
  21. "value": [0]
  22. }
  23. },
  24. "dropoff_longitude": {
  25. "floatList": {
  26. "value": [-87.63785]
  27. }
  28. },
  29. "dropoff_latitude": {
  30. "floatList": {
  31. "value": [41.893215]
  32. }
  33. },
  34. "pickup_longitude": {
  35. "floatList": {
  36. "value": [-87.63187]
  37. }
  38. },
  39. "pickup_latitude": {
  40. "floatList": {
  41. "value": [41.89204]
  42. }
  43. },
  44. "trip_start_timestamp": {
  45. "int64List": {
  46. "value": [1402934400]
  47. }
  48. },
  49. "trip_start_day": {
  50. "int64List": {
  51. "value": [2]
  52. }
  53. },
  54. "trip_start_hour": {
  55. "int64List": {
  56. "value": [16]
  57. }
  58. },
  59. "trip_start_month": {
  60. "int64List": {
  61. "value": [6]
  62. }
  63. },
  64. "fare": {
  65. "floatList": {
  66. "value": [3.25]
  67. }
  68. },
  69. "dropoff_census_tract": {
  70. "bytesList": {
  71. "value": ["17031081800"]
  72. }
  73. },
  74. "dropoff_community_area": {
  75. "bytesList": {
  76. "value": ["8"]
  77. }
  78. },
  79. "pickup_community_area": {
  80. "bytesList": {
  81. "value": ["8"]
  82. }
  83. },
  84. "trip_id": {
  85. "bytesList": {
  86. "value": ["8106c1f6-e6f3-426f-9aaf-b4e9703b4f10"]
  87. }
  88. }
  89. }
  90. }
  91. }