-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNN.evaluate(x,y) → "ValueError: Cannot use the given session to evaluate tensor" #966
Comments
Could you provide the wrapper class code (or some of it)? Are you using multithreading? |
Thanks for your reply, EllyMandiel! As far as I know, I am not using multithreading. I only have one GPU, and my TensorFlow build is configured to use the GPU. You may regret asking me for my tfl.DNN subclass code, because there's a lot in there which concerns the specifics of my project (protein folding). I hope it isn't too distracting. I am attaching a copy below.
|
Can you try to override evaluate, using the base class' evaluate, but using: |
Thanks again, Elly. I tried your suggestions. I added the following to MyDNNSubclass:
Other than printing my override notice and the part of the traceback that corresponds to my override code, everything is the same. I'm still ending with...
So, nothing has changed. |
Hello, So it has been a month since EllyMandiel attempted to assist me, and we reached a dead end. I believe that TFLearn's DNN.evaluate() is mis-handling TensorFlow Session objects (see documentation above). In the intervening time span, I almost managed to port my entire project over to raw TensorFlow. When I hit a wall there, I tried Keras. I have Keras working, but my models aren't training to same scores that I achieved with TFLearn. I'm not yet sure why, but I think it has something to do with the way that Keras processes batches of data. TFLearn was performing better, and training faster too. If anyone can help me understand my TFLearn bug, I would deeply appreciate it. Thanks! |
Hello again!
While I'm waiting to hear back from folks regarding the compatibility of TFLearn with scikit-learn's cross validation tools (Issue #965), I've decided to try building a cross-validation system myself. In doing so, I've encountered a more basic problem.
Here's a somewhat abridged version of my code:
NOTE 1: MyDNNSubclass is, as should be pretty obvious from its name, a subclass of TFLearn's DNN class. The subclass does NOT override evaluate().
NOTE 2: I have a Callback attached to the fit() method in MyDNNSubclass which performs early stopping. So even though I specify 40 epochs, that's an upper limit, and the fitting process usually does not run that long.
Here's a somewhat abridged version of a typical output:
You can see that my model initializes, and it fits. I've examined the output, and I'm getting learning. I can pass input to model.predict(), and it returns a tensor of the correct shape (matches the target).
But in order to build cross-validation myself, I need to compute the loss with cross-validation folds. For now, I'm just trying my test set. But I need model.evaluate() to run, and that's where I'm getting a failure.
Do I have to do something with a tensorflow.Session()? I thought that the Session object management would be handled by TFLearn code. I am looking at the TFLearn source and trying to figure it out.
Yes, I have some warnings. Perhaps they are relevant.
Thanks for any suggestions!
The text was updated successfully, but these errors were encountered: