0

I'm trying to copy a TensorFlow warmup file to a server using ansible copy module. Once its gets copied the container is throwing error:

020-06-15 08:20:30.288568: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:152] Running initialization op on SavedModel bundle at path: /models/usel/5
2020-06-15 08:20:36.389782: I external/org_tensorflow/tensorflow/cc/saved_model/loader.cc:333] SavedModel load for tags { serve }; Status: success: OK. Took 15678157 microseconds.
2020-06-15 08:20:36.469264: I tensorflow_serving/servables/tensorflow/saved_model_bundle_factory.cc:169] Wrapping session to perform batch processing
2020-06-15 08:20:36.469503: I tensorflow_serving/servables/tensorflow/bundle_factory_util.cc:153] Wrapping session to perform batch processing
2020-06-15 08:20:36.470255: I tensorflow_serving/servables/tensorflow/saved_model_warmup.cc:117] Starting to read warmup data for model at /models/usel/5/assets.extra/tf_serving_warmup_requests with model-warmup-options 
2020-06-15 08:20:36.470486: E tensorflow_serving/util/retrier.cc:37] Loading servable: {name: usel version: 5} failed: Data loss: corrupted record at 0. Please verify your warmup data is in TFRecord format.

I tried checking the encoding type:

[vagrant@test-machine assets.extra]$ file -i tf_serving_warmup_requests
tf_serving_warmup_requests: application/octet-stream; charset=binary

Wile copying the file via scp this is working fine, but its failing while copied via ansible.

I have also tried the ansible template module:

- name: Copy file with owner and permissions
  become: true
  become_user: "{{ app_user }}"
  template:
    src: tf_serving_warmup_requests.j2
    dest: "{{ tensorflow_warmup_dir }}/tf_serving_warmup_requests"
    output_encoding: '{{ item | default(omit, true) }}

But this doesn't work either.

vyshak m
  • 131
  • 1
  • 7
  • 2
    Use the [Copy Module](https://docs.ansible.com/ansible/latest/modules/copy_module.html) not the template module because this is for jinja2 processing. – JGK Jun 15 '20 at 09:08
  • I used template module to check the output_encoding option. I have also tried the copy module and I was getting the same issue. – vyshak m Jun 15 '20 at 10:00
  • What transfer mode is used by ansible ? Ansible should be able to use scp (add -vvv) and test the command it execute outside of ansible. – Et7f3XIV Feb 16 '23 at 08:58

0 Answers0