# No compressors were found

**URL:** <https://community.konduit.ai/t/no-compressors-were-found/2031>\
**Category:** SameDiff\
**Created:** [September 29, 2022, 8:30am UTC](https://community.konduit.ai/t/no-compressors-were-found/2031 "2022-09-29T08:30:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![SidneyLann](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/sidneylann/32/367_2.png) [@SidneyLann](https://community.konduit.ai/u/SidneyLann)\
**Post date:** [September 29, 2022, 8:30am UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/1 "2022-09-29T08:30:22Z")

</div>

[main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [JCublasBackend] backend  
[main] INFO org.nd4j.nativeblas.NativeOpsHolder - Number of threads used for linear algebra: 32  
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Backend used: [CUDA]; OS: [Linux]  
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Cores: [4]; Memory: [3.0GB];  
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Blas vendor: [CUBLAS]  
[main] INFO org.nd4j.linalg.jcublas.JCublasBackend - ND4J CUDA build version: 11.6.124  
[main] INFO org.nd4j.linalg.jcublas.JCublasBackend - CUDA device 0: [NVIDIA GeForce GTX 1080 Ti]; cc: [6.1]; Total memory: [11721244672]  
[main] INFO org.nd4j.linalg.jcublas.JCublasBackend - Backend build information:  
GCC: “7.5.0”  
STD version: 201103L  
DEFAULT\_ENGINE: samediff::ENGINE\_CUDA  
HAVE\_FLATBUFFERS  
HAVE\_CUDNN  
[main] ERROR org.nd4j.linalg.compression.BasicNDArrayCompressor - Error loading ND4J Compressors via service loader: No compressors were found. This usually occurs when running ND4J UI from an uber-jar, which was built incorrectly (without services resource files being included)  
Exception in thread “main” java.lang.ExceptionInInitializerError  
at org.nd4j.linalg.factory.Nd4j.getCompressor(Nd4j.java:5288)  
at org.nd4j.linalg.api.ndarray.BaseNDArray.reshape(BaseNDArray.java:3754)  
at org.nd4j.linalg.api.ndarray.BaseNDArray.reshape(BaseNDArray.java:3749)  
at org.nd4j.linalg.api.ndarray.BaseNDArray.reshape(BaseNDArray.java:3872)  
at org.nd4j.samediff.frameworkimport.IRProtobufExtensionsKt.ndarrayFromNameSpaceTensor(IRProtobufExtensions.kt:291)  
at org.nd4j.samediff.frameworkimport.tensorflow.ir.TensorflowIRTensor.toNd4jNDArray(TensorflowIRTensor.kt:139)  
at org.nd4j.samediff.frameworkimport.rule.attribute.NDArrayToIntAttributeValue.convertAttributes(NDArrayToIntAttributeValue.kt:56)  
at org.nd4j.samediff.frameworkimport.process.AbstractMappingProcess.applyProcess(AbstractMappingProcess.kt:187)  
at org.nd4j.samediff.frameworkimport.ir.IRFunctionsKt.importInfoForEachNodeInGraph(IRFunctions.kt:70)  
at org.nd4j.samediff.frameworkimport.tensorflow.ir.TensorflowIRGraph.importInfoForEachNode(TensorflowIRGraph.kt:160)  
at org.nd4j.samediff.frameworkimport.ImportGraph.importGraph(ImportGraph.kt:246)  
at org.nd4j.samediff.frameworkimport.tensorflow.importer.TensorflowFrameworkImporter.importFromGraph(TensorflowFrameworkImporter.kt:65)  
at org.nd4j.samediff.frameworkimport.tensorflow.importer.TensorflowFrameworkImporter.runImport(TensorflowFrameworkImporter.kt:74)

This error occurs on GPU on M2.1 in centos 8, both ND4J and SameDiff, tranning and inferrence. But the app run successfully on CPU in Windows 7.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 29, 2022, 10:29am UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/2 "2022-09-29T10:29:19Z")

</div>

@SidneyLann these errors seem very 1 off. I can clearly see the files in snapshots and the release: [https://s01.oss.sonatype.org/service/local/repositories/snapshots/archive/org/nd4j/nd4j-cuda-11.4/1.0.0-SNAPSHOT/nd4j-cuda-11.4-1.0.0-20220215.235600-1.jar/!/nd4j-jcublas.properties](https://s01.oss.sonatype.org/service/local/repositories/snapshots/archive/org/nd4j/nd4j-cuda-11.4/1.0.0-SNAPSHOT/nd4j-cuda-11.4-1.0.0-20220215.235600-1.jar/!/nd4j-jcublas.properties)

Are you actually getting a libc or version mismatch or something? Could you post some sort of a reproducer project? Your errors make zero sense to me and I don’t see anyone else mentioning this at all.

---

<div class="post-metadata">

**Author:** ![SidneyLann](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/sidneylann/32/367_2.png) [@SidneyLann](https://community.konduit.ai/u/SidneyLann)\
**Post date:** [September 29, 2022, 10:42am UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/3 "2022-09-29T10:42:09Z")

</div>

There are 2 same issues, and don’t know have they solved the problem?

> [@Training CNN error / CNN text classification](https://community.konduit.ai/t/training-cnn-error-cnn-text-classification/1322/39):
>
> It doesn’t look like it’s going to work. I once built the project with Maven “clean install -U” that should update the dependencies. When I start the project from Intellij using Run, the same error occurs. Even after I have invalidated the cache. If I start the output jar from maven this error comes: 13:50:25.205 [main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [JCublasBackend] backend 13:50:25.208 [main] ERROR org.nd4j.common.config.ND4JClassLoading - Cannot find class [org.nd4j.lin…

> [@NoClassDefFoundError - BasicNDArrayCompressor](https://community.konduit.ai/t/noclassdeffounderror-basicndarraycompressor/944):
>
> Hello, I have models trained on PC (windows) beta6 and beta7 lib versions. When I try to run those models on Android i receive error: Caused by: java.lang.RuntimeException: Error loading ND4J Compressors via service loader: No compressors were found. This usually occurs when running ND4J UI from an uber-jar, which was built incorrectly (without services resource files being included) at org.nd4j.linalg.compression.BasicNDArrayCompressor.loadCompressors(BasicNDArrayCompressor.java:64) at org…

The app can be run successfully if not used uber-jar.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 29, 2022, 10:50am UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/4 "2022-09-29T10:50:38Z")

</div>

@SidneyLann the stack trace also explains the problem though. That usually comes from files being missing. I don’t think it’s unreasonable for me to ask for a reproducer project.

Your pom would be a good start. If this actually is a problem and not just a configuration issue on your end then in order to fix it I need to reproduce it.

---

<div class="post-metadata">

**Author:** ![SidneyLann](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/sidneylann/32/367_2.png) [@SidneyLann](https://community.konduit.ai/u/SidneyLann)\
**Post date:** [September 29, 2022, 10:59am UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/5 "2022-09-29T10:59:35Z")

</div>

```
<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<nd4j.backend>nd4j-cuda-11.6</nd4j.backend>
	<java.version>17</java.version>
	<dl4j.version>1.0.0-M2.1</dl4j.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.nd4j</groupId>
		<artifactId>${nd4j.backend}</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.nd4j</groupId>
		<artifactId>${nd4j.backend}</artifactId>
		<version>${dl4j.version}</version>
		<classifier>linux-x86_64-cudnn</classifier>
	</dependency>
	<dependency>
		<groupId>org.deeplearning4j</groupId>
		<artifactId>deeplearning4j-core</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.deeplearning4j</groupId>
		<artifactId>deeplearning4j-nn</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.deeplearning4j</groupId>
		<artifactId>deeplearning4j-ui</artifactId>
		<version>${dl4j.version}</version>
	</dependency>
	<dependency>
		<groupId>org.nd4j</groupId>
		<artifactId>samediff-import-tensorflow</artifactId>
		<version>${dl4j.version}</version>
	</dependency>

```

±----------------------------------------------------------------------------+  
| NVIDIA-SMI 515.43.04 Driver Version: 515.43.04 CUDA Version: 11.7 |  
|-------------------------------±---------------------±---------------------+  
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |  
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |  
| | | MIG M. |  
|===============================+======================+======================|  
| 0 NVIDIA GeForce … Off | 00000000:01:00.0 Off | N/A |  
| 0% 43C P8 12W / 280W | 20MiB / 11264MiB | 0% Default |  
| | | N/A |  
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+  
| Processes: |  
| GPU GI CI PID Type Process name GPU Memory |  
| ID ID Usage |  
|=============================================================================|  
| 0 N/A N/A 1910 G /usr/libexec/Xorg 9MiB |  
| 0 N/A N/A 5240 G /usr/bin/gnome-shell 7MiB |  
±----------------------------------------------------------------------------+

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 29, 2022, 11:05am UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/6 "2022-09-29T11:05:01Z")

</div>

@SidneyLann just out of curiosity did you try with the default nd4j-cuda-11.6-platform? Also, did you check org.bytedeco.javacpp.logger.debug set to true? Given those files aren’t missing that usually means that’s the side effect of another problem (usually a native library missing)

If you’re using cudnn remember that you need the correct cudnn installed.

---

<div class="post-metadata">

**Author:** ![SidneyLann](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/sidneylann/32/367_2.png) [@SidneyLann](https://community.konduit.ai/u/SidneyLann)\
**Post date:** [September 29, 2022, 12:39pm UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/7 "2022-09-29T12:39:19Z")

</div>

1. cudnn installed correctly  
GCC: “7.5.0”  
STD version: 201103L  
DEFAULT\_ENGINE: samediff::ENGINE\_CUDA  
HAVE\_FLATBUFFERS  
HAVE\_CUDNN

2. add -platform no help

3. debug log no help  
Debug: Loading class org.bytedeco.javacpp.presets.javacpp  
Debug: Loading class org.bytedeco.javacpp.Loader  
Debug: Loading /home/sidney/.javacpp/cache/pcng-idea-ner-1.0.0-bin\_M2.1.jar/org/bytedeco/javacpp/linux-x86\_64/libjnijavacpp.so  
Debug: Loading class org.bytedeco.javacpp.presets.javacpp  
Debug: Loading class org.bytedeco.javacpp.Pointer  
Debug: Loading class org.bytedeco.javacpp.presets.javacpp  
Debug: Loading class org.bytedeco.cuda.global.cudart  
Debug: Loading library cudart  
Debug: Loading /home/sidney/.javacpp/cache/pcng-idea-ner-1.0.0-bin\_M2.1.jar/org/bytedeco/cuda/linux-x86\_64/libjnicudart.so  
Debug: Loading class org.bytedeco.javacpp.presets.javacpp  
Debug: Loading class org.bytedeco.cuda.global.cudart  
Debug: Loading class org.bytedeco.cuda.global.cublas  
Debug: Loading class org.bytedeco.javacpp.presets.javacpp  
Debug: Loading class org.bytedeco.cuda.global.cudart  
Debug: Loading class org.bytedeco.cuda.global.cublas  
Debug: Loading /usr/lib64/libcublasLt.so  
Debug: Loading /usr/lib64/libcublas.so  
Debug: Loading /home/sidney/.javacpp/cache/pcng-idea-ner-1.0.0-bin\_M2.1.jar/org/bytedeco/cuda/linux-x86\_64/libjnicublas.so  
[main] INFO org.nd4j.linalg.factory.Nd4jBackend - Loaded [JCublasBackend] backend  
Debug: Loading class org.nd4j.linalg.jcublas.bindings.Nd4jCuda  
Debug: Loading library curand  
Debug: Loading library cusolver  
Debug: Loading library cusparse  
Debug: Loading /lib64/libcudnn.so.8  
Debug: Loading /lib64/libcudnn\_ops\_infer.so.8  
Debug: Loading /lib64/libcudnn\_ops\_train.so.8  
Debug: Loading /lib64/libcudnn\_adv\_infer.so.8  
Debug: Loading /lib64/libcudnn\_adv\_train.so.8  
Debug: Loading /lib64/libcudnn\_cnn\_infer.so.8  
Debug: Loading /lib64/libcudnn\_cnn\_train.so.8  
Debug: Loading /lib64/libgomp.so.1  
Debug: Loading /home/sidney/.javacpp/cache/pcng-idea-ner-1.0.0-bin\_M2.1.jar/org/nd4j/linalg/jcublas/bindings/linux-x86\_64-cudnn/libnd4jcuda.so  
Debug: Loading /home/sidney/.javacpp/cache/pcng-idea-ner-1.0.0-bin\_M2.1.jar/org/nd4j/linalg/jcublas/bindings/linux-x86\_64-cudnn/libjnind4jcuda.so  
[main] INFO org.nd4j.nativeblas.NativeOpsHolder - Number of threads used for linear algebra: 32  
Debug: Loading class org.bytedeco.javacpp.presets.javacpp  
Debug: Loading class org.bytedeco.javacpp.PointerPointer  
Debug: Registering org.bytedeco.javacpp.PointerPointer[address=0x7fcdb4a8a870,position=0,limit=13,capacity=13,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcdb4a8a870,deallocatorAddress=0x7fcf1970e8d0]]  
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Backend used: [CUDA]; OS: [Linux]  
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Cores: [4]; Memory: [3.0GB];  
[main] INFO org.nd4j.linalg.api.ops.executioner.DefaultOpExecutioner - Blas vendor: [CUBLAS]  
Debug: Loading class org.bytedeco.javacpp.presets.javacpp  
Debug: Loading class org.bytedeco.javacpp.LongPointer  
Debug: Registering org.bytedeco.javacpp.LongPointer[address=0x7fcdb5af5f90,position=0,limit=2,capacity=2,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcdb5af5f90,deallocatorAddress=0x7fcf1970e830]]  
Debug: Registering org.bytedeco.javacpp.LongPointer[address=0x7fcdb5af6220,position=0,limit=2,capacity=2,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcdb5af6220,deallocatorAddress=0x7fcf1970e830]]  
Debug: Loading class org.bytedeco.javacpp.presets.javacpp  
Debug: Loading class org.bytedeco.javacpp.IntPointer  
Debug: Registering org.bytedeco.javacpp.IntPointer[address=0x7fcdb5b0a260,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcdb5b0a260,deallocatorAddress=0x7fcf1970e810]]  
Debug: Registering org.bytedeco.javacpp.LongPointer[address=0x7fcd7e5ac980,position=0,limit=0,capacity=0,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcd7e5ac980,deallocatorAddress=0x7fcf1970e830]]  
Debug: Registering org.bytedeco.javacpp.LongPointer[address=0x7fcd7e5ac9a0,position=0,limit=0,capacity=0,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcd7e5ac9a0,deallocatorAddress=0x7fcf1970e830]]  
Debug: Registering org.bytedeco.javacpp.PointerPointer[address=0x7fcd7e5af460,position=0,limit=32,capacity=32,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcd7e5af460,deallocatorAddress=0x7fcf1970e8d0]]  
Debug: Registering org.bytedeco.javacpp.IntPointer[address=0x7fcd7e5b1500,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcd7e5b1500,deallocatorAddress=0x7fcf1970e810]]  
Debug: Registering org.bytedeco.javacpp.IntPointer[address=0x7fcd7e5b1fa0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcd7e5b1fa0,deallocatorAddress=0x7fcf1970e810]]  
Debug: Registering org.bytedeco.javacpp.IntPointer[address=0x7fcd7e649ee0,position=0,limit=1,capacity=1,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcd7e649ee0,deallocatorAddress=0x7fcf1970e810]]  
Debug: Registering org.bytedeco.javacpp.LongPointer[address=0x7fcd7e649f00,position=0,limit=2,capacity=2,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcd7e649f00,deallocatorAddress=0x7fcf1970e830]]  
Debug: Registering org.bytedeco.javacpp.LongPointer[address=0x7fcd7e649f20,position=0,limit=2,capacity=2,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0x7fcd7e649f20,deallocatorAddress=0x7fcf1970e830]]  
[main] ERROR org.nd4j.linalg.compression.BasicNDArrayCompressor - Error loading ND4J Compressors via service loader: No compressors were found. This usually occurs when running ND4J UI from an uber-jar, which was built incorrectly (without services resource files being included)

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 29, 2022, 12:48pm UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/8 "2022-09-29T12:48:07Z")

</div>

@SidneyLann Looking at this I guess it’s due to the nd4j-cuda dependency not having a compressor implementation. As usual the “real” reason for that isn’t just “this was wrong”. We have a good setup for cpu for compression but compression + GPU is going to introduce all sorts of bugs which is why we don’t have one.

It will take some work to do correctly so I may just allow it to not have one defined. Let me get back to you on a proper fix after a bit more thinking.

---

<div class="post-metadata">

**Author:** ![SidneyLann](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/sidneylann/32/367_2.png) [@SidneyLann](https://community.konduit.ai/u/SidneyLann)\
**Post date:** [September 29, 2022, 2:04pm UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/9 "2022-09-29T14:04:04Z")

</div>

OK. now to use non-uber-jar for temp use. Thanks.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [September 29, 2022, 11:46pm UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/10 "2022-09-29T23:46:27Z")

</div>

@SidneyLann [Adds cuda compressor by agibsonccc · Pull Request #9794 · deeplearning4j/deeplearning4j · GitHub](https://github.com/deeplearning4j/deeplearning4j/pull/9794) this needs more testing yet but it seems like the initial issues are already addressed with the way the cpu compressor is implemented. I just added a backend specific one.

---

<div class="post-metadata">

**Author:** ![SidneyLann](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/sidneylann/32/367_2.png) [@SidneyLann](https://community.konduit.ai/u/SidneyLann)\
**Post date:** [September 30, 2022, 12:02am UTC](https://community.konduit.ai/t/no-compressors-were-found/2031/11 "2022-09-30T00:02:12Z")

</div>

Ok. I will try after new snapshot build.
