Skip to content
New issue

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

Error in OMExternalConstants.inc when opening model_name.constants.bin file on z/OS #2987

Open
christopherlmunoz opened this issue Oct 25, 2024 · 2 comments

Comments

@christopherlmunoz
Copy link

christopherlmunoz commented Oct 25, 2024

After linking the .so, run this client command resulted with an extra backtick or misc characters getting added to file name after converting from ASCII to EBCIDIC.

client/bin/modelzoo --lib mnist-8-with-binary.so --file mnist-8.tests --validate -m VERBOSE --fc-parms 0.01,0.158752,9,10
Saved mnist-8-with-binary.so for debug testing with C clients
Created mnist-8-with-binary.jar for Java clients
Iteration 0 dataset 0: Reading
gen_data_set_lists() loading 1 input tensor(s):
gen_next_tensor() processing tensor with shape ( 1 1 28 28 ) totaling 784 elements of type ONNX_TYPE_FLOAT
gen_data_set_lists() loading 1 expected output tensor(s):
gen_next_tensor() processing tensor with shape ( 1 10 ) totaling 10 elements of type ONNX_TYPE_FLOAT
Iteration 0 dataset 0: Running
Error while opening mnist-8.constants.bin`
Error while opening mnist-8.constants.bin�K������k�K������k`��K�����`
void omMMapBinaryFile(
    void **constAddr, char *filename, int64_t size, int64_t isLE) {
  checkEndianness(isLE);
  char *fname = filename;
#ifdef __MVS__
  // Convert the file name to EBCDIC for the open call.
  char *tPath;
  size_t tLen = strlen(fname);
  tPath = (char *)malloc(tLen);
  if (!tPath) {
    fprintf(stderr, "Error while malloc");
    return;
  }
  memcpy(tPath, fname, tLen);
  __a2e_s(tPath);
  fname = tPath;
  //fname[tLen] = '\0'; --------------------------------------------------->  possible fix. 
#endif
@christopherlmunoz
Copy link
Author

@tungld Hi, please let me know if you need more information. Thank you for taking a look.

@tungld
Copy link
Collaborator

tungld commented Oct 30, 2024

@christopherlmunoz adding the terminator looks good. Could you create a PR to fix this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants