How Do I View a Dump File?

This function will be brought offline in later versions. You are advised to use the function of Viewing Dump Files in the current version.

Dump files cannot be viewed with a text tool. Therefore, you need to convert your dump file into a NumPy file and save the NumPy file as a text file using numpy.savetxt.

  1. Log in to the development environment as the installation user.
  2. Go to the ${INSTALL_DIR}/tools/operator_cmp/compare directory. Replace ${INSTALL_DIR} with the actual CANN component directory. If the Ascend-CANN-Toolkit package is installed as the root user, the CANN component directory is /usr/local/Ascend/ascend-toolkit/latest..
  3. Run the dump_data_conversion.py script to convert the dump file into a NumPy file. The following is an example:

    python3 dump_data_conversion.py -target numpy -type offline -i $HOME/dump -o $HOME/dumptonumpy

    For details about the parameters of the dump_data_conversion.py script, see How Do I Convert an .npy File into a Dump File?.

  4. Use Python to save the NumPy data into a text file. The following is an example.

    $ python3

    Python 3 (default, Mar  5 2020, 16:07:54)[GCC 5.4.0 20160609] on linuxType "help", "copyright", "credits" or "license" for more information.

    >>> import numpy as np

    >>> a = np.load("$HOME/dumptonumpy/Pooling.pool1.1.1147.1589195081588018.output.0.npy")

    >>> b = a.flatten()

    >>> np.savetxt("$HOME/dumptonumpy/Pooling.pool1.1.1147.1589195081588018.output.0.txt", b)

    The shape and Dtype no longer exist in the .txt file. For details, visit the NumPy website.