Scipy, Numpy, Django, Docker Issue

  django, docker, python, scipy, spacy

Having issues with scipy and numpy.
This code, part of a Django app, runs perfectly when run on my windows 10 system:

try:
    # sparse_load is a scipy.sparse.csr_matrix
    sparse_load = scipy.sparse.load_npz(cache)
    logger.info('Got sparse_load')
    concept_alias_tfidfs = sparse_load.astype(numpy.float32)
except:
    logger.exception('Something went wrong!' ) 
# code continues here ...

It also runs perfectly when running inside a docker container deployed on a Linux server.
The issue is that the type conversion (sparse_load.astype(numpy.float32)) crashes my app when running in a docker container deployed on Docker Desktop running on Windows 10. The strange thing is that logger.exception is never executed! I’ve tried other type conversions with the same result and also tried removing the astype altogether which resulted in another crash further down in the code (again w/o hitting the exception handler placed around that piece of code.

Thoughts?

Source: Docker Questions

LEAVE A COMMENT