HiRISE | Convert HiRISE PDS IMG files to 3D meshes with normal maps | 3D Animation library
kandi X-RAY | HiRISE Summary
kandi X-RAY | HiRISE Summary
Convert HiRISE Digital Terrain Models (DTM) to 3D meshes (.stl) and normal maps for display in OpenGL.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Compute mesh coordinates
- Compute normals of the data .
- Saves a binary STL to a binary STL file .
- Compute a normal vector from a point b .
- Main entry point for the script .
- load an image
- Save a normal map .
HiRISE Key Features
HiRISE Examples and Code Snippets
Community Discussions
Trending Discussions on HiRISE
QUESTION
I'm trying to make a simple CNN classifier model. For my training images (BATCH_SIZEx227x227x1) and labels (BATCH_SIZEx7) datasets, I'm using numpy ndarrays that are fed to the model in batches via ImageDataGenerator
. The loss function I'm using is tf.nn.sparse_categorical_crossentropy. The problem arises when the model tries to train; the model (batch size here is 1 for my simplified experimentations) outputs a shape of [1, 7] and labels is shape [7].
I'm almost positive I know the cause of this, but I am unsure how to fix it. My hypothesis is that sparse_categorical_crossentropy is squeezing the dimensions of my labels (e.g. when BATCH_SIZE is 2, the input, ground-truth label shape is squeezed from [2, 7] to [14]), making it impossible for me to fix the label shape, and all my attempts to fix logits shape have been fruitless.
I originally tried fixing labels shape with np.expand_dims
. But the loss function always flattens the labels, no matter how I expand the dimensions.
Following that, I tried adding a tf.keras.layers.Flatten()
at the end of my model to get rid of the extraneous first dimension, but it had no effect; I still got the same exact error.
Following that, tried using tf.keras.layers.Reshape((-1,))
to squeeze all the dimensions. However, that resulted in a different error:
in sparse_categorical_crossentropy logits = array_ops.reshape(output, [-1, int(output_shape[-1])]) TypeError: int returned non-int (type NoneType)
Question: How can I squash the shape of the logits to be the same shape as the labels returned by the sparse_categorical_crossentropy?
...ANSWER
Answered 2019-May-25 at 10:14No, you got the cause all wrong. You are giving one-hot encoded labels, but sparse_categorical_crossentropy
expects integer labels, as it does the one-hot encoding itself (hence, sparse).
An easy solution would be to change loss to categorical_crossentropy
, not the sparse version. Also note that y_true
with shape (7,) is incorrect, it should be (1, 7).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install HiRISE
You can use HiRISE like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page