# Importing BERT fails with Unable to find name dataType for op name: "tensorarrayv3"

**URL:** <https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759>\
**Category:** SameDiff\
**Created:** [January 30, 2022, 3:58pm UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759 "2022-01-30T15:58:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiptos](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/xiptos/32/275_2.png) [@xiptos](https://community.konduit.ai/u/xiptos)\
**Post date:** [January 30, 2022, 3:58pm UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/1 "2022-01-30T15:58:11Z")

</div>

I’m sorry if this is a naive question, but when I try to import the `bert_mrpc_frozen.pb` model with

```auto
TensorflowFrameworkImporter tensorflowFrameworkImporter = new TensorflowFrameworkImporter();
SameDiff sd = tensorflowFrameworkImporter.runImport(frozenBertPB.getAbsolutePath(), Collections.emptyMap());

```

I get the following exception:

```auto
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.nd4j.samediff.frameworkimport.tensorflow.importer.TensorflowFrameworkImporter.importFromGraph(TensorflowFrameworkImporter.kt:58)
	at org.nd4j.samediff.frameworkimport.tensorflow.importer.TensorflowFrameworkImporter.runImport(TensorflowFrameworkImporter.kt:64)
	at pt.ipb.erisk.data.bert.EriskBertTrainer.main(EriskBertTrainer.java:41)
Caused by: java.lang.IllegalArgumentException: Unable to find name dataType for op name: "tensorarrayv3"
argDescriptor {
  name: "outputs"
  argType: OUTPUT_TENSOR
}
.name
	at org.nd4j.samediff.frameworkimport.rule.attribute.BaseAttributeExtractionRule.argDescriptorTypesForOutputName(BaseAttributeExtractionRule.kt:153)
	at org.nd4j.samediff.frameworkimport.process.AbstractMappingProcess.<init>(AbstractMappingProcess.kt:105)
	at org.nd4j.samediff.frameworkimport.tensorflow.process.TensorflowMappingProcess.<init>(TensorflowMappingProcess.kt:49)
	at org.nd4j.samediff.frameworkimport.tensorflow.process.TensorflowMappingProcess.<init>(TensorflowMappingProcess.kt:48)
	at org.nd4j.samediff.frameworkimport.tensorflow.definitions.TensorflowOpDeclarationsKt.<clinit>(TensorflowOpDeclarations.kt:526)
	... 3 more

```

I do have the files `nd4j-op-def.pbtxt`, `tensorflow-mapping-ruleset.pbtxt` and `tensorflow-op-def.pbtxt` in the `src/main/resources` dir… what am I doing wrong?

Best,

/rp

---

<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:** [January 31, 2022, 4:06am UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/2 "2022-01-31T04:06:28Z")

</div>

@xiptos where did you grab the files for that? Are you using the files from master + 1.0.0-M1.1?

These issues usually come from the op descriptors being out of sync. I would try the version from snapshots just in case.

---

<div class="post-metadata">

**Author:** ![xiptos](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/xiptos/32/275_2.png) [@xiptos](https://community.konduit.ai/u/xiptos)\
**Post date:** [January 31, 2022, 11:28am UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/3 "2022-01-31T11:28:28Z")

</div>

I believe it is the file from master:  
[https://github.com/eclipse/deeplearning4j/tree/master/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/resources](https://github.com/eclipse/deeplearning4j/tree/master/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/resources)  
and  
[https://github.com/eclipse/deeplearning4j/tree/master/nd4j/samediff-import/samediff-import-tensorflow/src/main/resources](https://github.com/eclipse/deeplearning4j/tree/master/nd4j/samediff-import/samediff-import-tensorflow/src/main/resources)

How can I try the SNAPSHOTs?

Thank you very much, @agibsonccc !

---

<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:** [January 31, 2022, 12:06pm UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/4 "2022-01-31T12:06:19Z")

</div>

@xiptos [Snapshots - Deeplearning4j](https://deeplearning4j.konduit.ai/multi-project/explanation/snapshots)

---

<div class="post-metadata">

**Author:** ![xiptos](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/xiptos/32/275_2.png) [@xiptos](https://community.konduit.ai/u/xiptos)\
**Post date:** [January 31, 2022, 9:35pm UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/5 "2022-01-31T21:35:24Z")

</div>

Thank you again, @agibsonccc. I believe that the -platform is out of sync, so I tried to use the nd4j-native, as suggested here: [https://deeplearning4j.konduit.ai/multi-project/explanation/snapshots?\_ga=2.93128093.1482849684.1643496468-1646476021.1643231843](https://deeplearning4j.konduit.ai/multi-project/explanation/snapshots?_ga=2.93128093.1482849684.1643496468-1646476021.1643231843)  
However, even after adding openblas dependency, I’m still having dependency problems. In Apple Silicon, I get:

```auto
Caused by: java.lang.UnsatisfiedLinkError: Could not find jniopenblas_nolapack in class, module, and library paths.
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1705)
	... 37 more

```

And in Linux x86\_64:

```auto
Caused by: java.lang.UnsatisfiedLinkError: Could not find jnind4jcpu in class, module, and library paths.
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1705)
	... 31 more

```

I cannot find the dependencies that would solve this missing libraries…

My dependency list is:

```auto
dl4j_version = "1.0.0-SNAPSHOT"

implementation "org.deeplearning4j:deeplearning4j-core:${dl4j_version}"
implementation "org.nd4j:nd4j-native:${dl4j_version}"
implementation "org.nd4j:samediff-import-tensorflow:${dl4j_version}"
implementation 'org.bytedeco:openblas-platform:0.3.13-1.5.5'
implementation 'org.bytedeco:mkl-platform:2021.1-1.5.5'

```

What can I try more?

Cheers!

---

<div class="post-metadata">

**Author:** ![xiptos](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/xiptos/32/275_2.png) [@xiptos](https://community.konduit.ai/u/xiptos)\
**Post date:** [February 1, 2022, 8:42pm UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/6 "2022-02-01T20:42:16Z")

</div>

@agibsonccc, the only way to get jnind4jcpu (or other backend - also tried cuda) is through the -platform?  
I cannot find any other alternative in the snapshots repository… if it is out of sync it becomes impossible to download the dependencies, doesn’t it?

Sorry about that… ☹

---

<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:** [February 2, 2022, 10:52pm UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/7 "2022-02-02T22:52:54Z")

</div>

@xiptos please ensure you’re using the new snapshots repository:  
[https://s01.oss.sonatype.org/](https://s01.oss.sonatype.org/)

Sorry we just updated the site there. Sonatype is migrating all open source projects (not just us) to this new URL. I’ll make sure to update the docs. Could you please try again?

Thanks!

---

<div class="post-metadata">

**Author:** ![xiptos](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/xiptos/32/275_2.png) [@xiptos](https://community.konduit.ai/u/xiptos)\
**Post date:** [February 3, 2022, 10:32am UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/8 "2022-02-03T10:32:01Z")

</div>

Thank you, @agibsonccc. Almost there! 🙂  
I believe that only the windows native library is available. Is there any way to “force” to use previous version of the linux or macOS?

---

<div class="post-metadata">

**Author:** ![xiptos](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/xiptos/32/275_2.png) [@xiptos](https://community.konduit.ai/u/xiptos)\
**Post date:** [February 3, 2022, 10:51am UTC](https://community.konduit.ai/t/importing-bert-fails-with-unable-to-find-name-datatype-for-op-name-tensorarrayv3/1759/9 "2022-02-03T10:51:43Z")

</div>

Found it. Just specify the available version in the snapshots repository:

```auto
runtimeOnly "org.nd4j:nd4j-native:1.0.0-20220203.023328-127:macosx-x86_64-onednn-avx2"

```

Cheers!
