tensorflow / tensorflow/java

Caused by: java.lang.ClassNotFoundException: org.tensorflow.ndarray.NdArray

Open
#273 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
928
Forks
227
PR merge metrics
No merged PRs in 30d

Description

The maven project that I have works fine if run it as Java Application. It does not raise error if I build it eclipse. This a FiJi plugin. As a result, if I copy paste jar file into "FiJi/plugins" or use "install plugins" I still do not have any problem. However, when I choose the plugin, it raises the following error.

In brief, I have models (tensorflow) trained using Python. Then, I load the models in tensorflow/java (0.3.1) . As I wrote above I do not have any problem (if I run the project as Java Application) loading the models and predicting images using tensorflow/java.

I am using windows, but I have the same problem if I run it on Linux as well.


(Fiji Is Just) ImageJ 2.0.0-rc-69/1.53c; Java 1.8.0_172 [64-bit]; Windows 8.1 6.3; 69MB of 12155MB (<1%)
 
java.lang.NoClassDefFoundError: org/tensorflow/ndarray/NdArray
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
	at java.lang.Class.getConstructor0(Class.java:3075)
	at java.lang.Class.newInstance(Class.java:412)
	at org.scijava.plugin.PluginInfo.createInstance(PluginInfo.java:304)
	at org.scijava.command.CommandInfo.createInstance(CommandInfo.java:247)
	at org.scijava.command.CommandModule.instantiateCommand(CommandModule.java:248)
	at org.scijava.command.CommandModule.<init>(CommandModule.java:98)
	at org.scijava.command.CommandInfo.createModule(CommandInfo.java:325)
	at org.scijava.module.DefaultModuleService.createModule(DefaultModuleService.java:167)
	at org.scijava.module.DefaultModuleService.run(DefaultModuleService.java:206)
	at org.scijava.module.DefaultModuleService.run(DefaultModuleService.java:197)
	at org.scijava.module.DefaultModuleService.run(DefaultModuleService.java:182)
	at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:304)
	at net.imagej.legacy.DefaultLegacyHooks.interceptRunPlugIn(DefaultLegacyHooks.java:163)
	at ij.IJ.runPlugIn(IJ.java)
	at ij.Executer.runCommand(Executer.java:150)
	at ij.Executer.run(Executer.java:68)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.tensorflow.ndarray.NdArray
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 19 more

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by installing the Maven-built JAR in Fiji and selecting the plugin; the stack trace enters org.scijava.plugin.PluginInfo.createInstance and reports that org.tensorflow.ndarray.NdArray is unavailable. Inspect the plugin's packaged dependencies and classpath, then verify that the plugin starts successfully in Fiji on the affected platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, tensorflow
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.