Closed mandar2812 closed 5 years ago
One thing I notice is this
DynaML>import org.platanios.tensorflow.api._
import org.platanios.tensorflow.api._
DynaML>Shape(1, 2, 3)
res1: Shape = [1, 2, 3]
DynaML>res1.toTensor
res2: Tensor[INT64] = INT64[3]
I see that calling .toTensor
method on a Shape
object returns a INT64
tensor by default, is this causing the problem maybe?
@mandar2812 Yes the default shape data type is not INT64
and that is because of an awkward kind of hack within the TensorFlow main codebase. I'll post a couple links to relevant GitHub issues I filed a while ago, once I get to the office.
Regarding the error you're getting. Would it be too difficult to update to 0.4.0-SNAPSHOT
? I made some major updates and now auto-differentiation is also type-safe, which should hopefully resolve the error you're getting.
@mandar2812 Please disregard my previous comment. I think I'll be defaulting to INT32
for shape to tensor conversions, but will update you on a couple of days.
The relevant TF issue is here.
@mandar2812 I settled on defaulting to INT32
for shapes as that is what the TF Python API does and also because switching to INT32
results in a 7-fold performance increase for my MT library, when working on GPUs. :)
So, I'll close this for now and feel free to reopen if the issue persists for you for some reason. I'll be pushing a full 0.4.0
release later today hopefully. I'm only currently having some issues with Scala 2.11 support that I hope to resolve soon.
@eaplatanios I'm eagerly waiting for the 0.4.0
release, DynaML branch tf-0.4.0
is tracking the last tf-scala snapshot. I am able to compile my code (the part of it which depends on tf-scala). Only problem I am noticing is that resolution of implicits is a bigger challenge in the typed Output and Tensor API, especially when it comes to declaring estimators! I saw some of your recent commits were bug fixes around implicits. I hope they help in this regard! Good luck with the release!
[EDIT]: So the main problem I am observing is the resolution of implicts around NestedStructure.Aux[(X, Y), (XT, YT), ...]
. These problems are occurring in DynaML's test suite, if you want to take a look I would be happy to point them out, especially if it helps in a better tf-scala release. Let me know.
@mandar2812 Thanks a lot! It's great to hear you've been updating to support 0.4.0. :) And yes, there was an issue with resolution of implicits. It's been resolved for Scala 2.12, but I'm having issues with 2.11. Shapeless' Lazy
/Strict
seems to not be working correctly on 2.11 and so I'll try to resolve this by getting some help from the shapeless community, as I feel it shouldn't be a problem on our end.
So after updating DynaML code base to be compatible with tf-0.3.0, see branch tf-0.3.0, the cifar.sc example throws errors.