Separated command queues between connections

(#250) It was found that commands from different BluetoothGatt’s are synchronized so it is possible to decouple synchronization of commands for different connections. Thanks to that if there are two or more connections opened and one connection would get stalled — other connections may continue to work without stalling — with a single command queue shared between connections it was not possible.

Can someone merge this pull request?

It still requires some slight changes but you can expect it will arrive soon.

Cool!!!
Thanks for your help.
Osvaldo.
On Tue, Aug 15, 2017 at 4:06 PM, Paweł Urban<EMAIL_ADDRESS>wrote:

It still requires some slight changes but you can expect it will arrive
soon.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Polidea/RxAndroidBle/pull/260#issuecomment-322589251,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAXiMtJ7c-5TyiL90dt2wWTGq4VHCJUmks5sYghrgaJpZM4Osmk0
.

--
Osvaldo Mercado Espinel
Mobile Developer Senior | Koombea
T: + (57)<PHONE_NUMBER> -<PHONE_NUMBER>
skype: osmer_jr | twitter: @osvaldomercado
W: www.koombea.com
http://www.koombea.com/

were the code changes requested approved?


Model checkpoints on Hugging Face

Hey there! Awesome work with ProtST! It would be great to have the model checkpoints on the Hugging Face Hub. Here are the docs for how to upload them: https://huggingface.co/docs/hub/models-uploading. Let me know if I can help with that!

Hi, thank you for your interest in our work. A huggingface hub for ProtST (https://huggingface.co/katarinayuan/ProtST/tree/main/pretrained_ckpt) has been created to store the pretraining model checkpoints as suggested. Please let us know if there are further questions.


TBEL Scritping option missing in version 3.7.0PE rule engine

Hi
I updated my ThingsBoard instance to version 3.7.0PE and the option to use TBEL scripting disappeared from the nodes in the rule engine. Has TBEL been discontinued?
It seems the scripts have all reverted to the JavaScript versions.
Thanks.
Matthew.

The issue worked itself out. I am not sure how.


Feature request: Allow permanent display of on-hover information

I'm very new to g-code, and the on-hover information is fantastic and indispensable.  It would be even better if we could always display the information on the same line after the line ends.  I'm not sure if you've used IntelliJ, but that IDE presents information in that way often.  I think it would make this plugin even better.
Thanks so much for the excellent plugin!

Excellent idea!
I'm enjoying a little break from this project now that I finally got it on marketplace, but I'll put this "on the roadmap".
Note to self: https://vscode.rocks/decorations/

Proof of Concept
@brandon-fryslie I looked at implementing your idea of "annotation after the end of the line" (called "decoration" in VS Code) but I didn't like how it was shaping up.  What happens when there are multiple words on the same line, what if the definition is really verbose, and how to handle multiple instances of a word?
Today I had the idea to simply display the dictionary.  This would work like the native command "Markdown: Open Preview to the Side".  See screenshot below.  I think this looks promising.

Added the G-Code: Show the dictionary command in v0.2.0, which is now live on the marketplace.


Monkeyswing ignored if placed under trapdoors in stacked rooms

Monkeyswing apparently is ignored by Lara if it's placed under trapdoors only in stacked rooms. In TRNG set the blocks as monkeyswing in the rooms above the trapdoors and in the room where they are placed, make MS working again but TEN ignores this setting.
Test level is attached both as TEN and TRNG version.
monkeyswing_issue.zip

I can't reproduce this issue. It works if you apply monkeyswing to the same room where trapdoor is placed:

Remove portal from the block where you want to apply monkey flag
Apply monkey flag to a solid block
Reapply portal to the block
Place trapdoor / bridge on that block
Observe it working


How does it compare to browserify-hmr?

https://github.com/AgentME/browserify-hmr
https://github.com/AgentME/ud

Please read this article on Amok and this article on Amokify for more context

I'll assume browserify-hrm is basically webpack-hrm, skimmed it and it looks identical. Hot module replacements have issues, it executes the changed code via eval which is really troublesome, the new code is not available in the debugger for starters. Compared to amok, which does not eval nor execute anything. The entire script is just updated via the runtime, shows up in the debugger as updated, and works great with developer tools.
Except for the eval vs no eval thing, to make functions live with HRM you would have to wrap all your functions in your entire application. This can obviously be done with a transform, but as far as I know no such transform exists to date.
Lets say such a transform was available, which I would assume @AgentME is already working on since he's laying the groundwork with his ud library. There's a problem with wrapping every single function at every nesting level, and that is that it is very expensive. You add a lot of indirection which will kill perf.
Take the following example, you can edit this with Amok as is without any code generation or special tricks having to take place, it just tells the debugger to update the source code.
(function() {
  setInterval(function() {
    (function() {
      var greeting = 'hello';

      setTimeout(function() {
        var subject = 'world';
        setTimeout(function() {
          console.log(greeting, world);
        }, 1000);
      }, 1000);
    }());
  }, 1000);
}());

I'll leave it as an exercise to wrap that with guards.
Now, Amokify does generate code and it wraps top level expressions with with execution guards like those found in that ud library (might use that btw @AgentME instead of rolling my own, cheers!).
But, it only wraps top level module expressions because they are the only ones that can cause the module to change. Functions are still being kept live by amok after all so the perf impact is essentially none for code that is actually executing.

They seem to have similar goals for live updating code, but take fundamentally different techniques. Amok uses v8 debugger features to update code, and Browserify-HMR and Webpack HMR rely on pure javascript by just re-executing changed modules and relying on the re-executed modules to use the HMR API to allow themselves to handle the specifics of updating the running page.
Using the v8 debugger features appears to allow Amok to update function definitions even within closures and avoid re-executing expressions, which makes it more likely to be useful with code not written specifically with it in mind. However, its dependency on v8's debugger connection has cons too: You can't use it with non-v8 browsers, and you can only use it when you can set up a debugger connection. This makes setting up mobile debugging a bit more complicated (assuming your mobile browser supports it; React Native may be a no-go), and precludes you from using it to hot-patch code for users in production (Yeah, this is a little ambitious of an idea on normal sites, but it could easily be a killer feature for a jsfiddle-like site). You're also limited by what code updates v8 is able to understand. How it will handle very creative changes that rename values or refactor expressions could be very unpredictable unless you're closely familiar with v8's code. (Though this usually isn't a big deal in development if an update is taken wrongly occasionally when you can refresh to get back to a good state.) The HMR way is more explicit about how updates are handled, which does require more cooperation from the code.
@caspervonb Glad to see someone sees what I'm going at with ud. I've been picturing a transform (probably a babel plugin actually so it plays nice with Babel and ES6, gets its AST handling, and isn't Browserify or Webpack specific) which either automatically wraps top-level declarations with ud calls or only wraps top-level declarations that opt in through an ES7 or comment decorator. I'm still not sure on the specifics (should top-level variable declarations by default be wrapped with ud.defonce so they're only set on the first run? Reading about Amok is pushing me toward that way if I do make it automatic. Should there be a way for a specific declaration to opt out(in) of that? If the code itself uses calls to ud directly in top-level declarations, will the transform play nicely with that? It's important that the transform doesn't interfere with code that has its own idea of how to handle updates or make that more complicated.), so I'm using ud directly in a few applications for now to help figure out what common patterns could be automated.
I don't know if ud's code will directly be very useful for you as-is. The most interesting parts of it are interfacing with the HMR API to implement defonce, and the function/class wrapper to allow the illusion of replacing a function's code (which comes for free properly in the v8 way). The conventions or terminology in ud's API might be useful in thinking about ways that livecoding should work.

Using the v8 debugger features appears to allow Amok to update function definitions even within closures and avoid re-executing expressions, which makes it more likely to be useful with code not written specifically with it in mind.

Basically, the rule of thumb is as long as it compiles it works. Now I'm not advocating that old school jQuery soup is the way to go but Amok would work with it.

You can't use it with non-v8 browsers

True, currently only Chrome and Chromium is supported.
I am likely to support the chakra runtime soon as the runtime apparently supports live function patching. Microsoft also rolls their own bridge for the chrome protocol too so theres very little Amok needs to do in order to support it. We basically just have to spawn their bridge (Written in C/C++) in an package basically.
In the same tune node is also likely to come soon with them supporting the protocol Amok uses directly (chrome debugging protocol).
However, having to depend on a debugger feature that is not universal at the time is troublesome for development, as I can't really just decide to support a runtime because I want to, it needs to have the required functionality.

You can only use it when you can set up a debugger connection.

True, but you also get remote developer tools in the process.

This makes setting up mobile debugging a bit more complicated (assuming your mobile browser supports it; React Native may be a no-go), and precludes you from using it to hot-patch code for users in production

True, currently I'm not too sure how this will work out with JavaScriptCore at all. I've read some commits and patches that points to that this might be a solvable problem, but have not been able to pursue it. Personally its something I want to get, so we can have at-least one runtime per platform (desktop, mobile and web). Until I have a device to test and develop with, it will remain unresolved.

Precludes you from using it to hot-patch code for users in production

Yep Amok is a debugger client, and it's a command line executable so any sort of production mode is nonsensical.

You're also limited by what code updates v8 is able to understand. How it will handle very creative changes that rename values or refactor expressions could be very unpredictable unless you're closely familiar with v8's code.

I'd say this is an untrue statement, If you're writing something like Amok or Amokify, yeah can't be clueless about how it works.
The actual setScriptSource feature is damn hard to break, I've yet to come up with an example that breaks it.

The HMR way is more explicit about how updates are handled, which does require more cooperation from the code.

You can use HMR to apply side effects after amok has patched things too. When doing R&D with Amokify I considered this, but eventually concluded that I did not need HMR for what I wanted Amokify to do (https://github.com/caspervonb/amok/issues/136) and going with an eval free approach in order to not break other devtools and debuggers view of what a source file contains.

Glad to see someone sees what I'm going at with ud. I've been picturing a transform (probably a babel plugin actually so it plays nice with Babel and ES6, gets its AST handling, and isn't Browserify or Webpack specific) which either automatically wraps top-level declarations with ud calls or only wraps top-level declarations that opt in through an ES7 or comment decorator. I'm still not sure on the specifics (should top-level variable declarations by default be wrapped with ud.defonce so they're only set on the first run? Reading about Amok is pushing me toward that way if I do make it automatic. Should there be a way for a specific declaration to opt out(in) of that? If the code itself uses calls to ud directly in top-level declarations, will the transform play nicely with that? It's important that the transform doesn't interfere with code that has its own idea of how to handle updates or make that more complicated.), so I'm using ud directly in a few applications for now to help figure out what common patterns could be automated.

Since Amokify has the starting point of all functions are already updated its an easy case for me, I only have to make transformations that decide if expressions in the module scope should execute or not since they are the only ones that can cause any side effects.

I don't know if ud's code will directly be very useful for you as-is. The most interesting parts of it are interfacing with the HMR API to implement defonce, and the function/class wrapper to allow the illusion of replacing a function's code (which comes for free properly in the v8 way). The conventions or terminology in ud's API might be useful in thinking about ways that livecoding should work.

Had only skimmed it at the time, It gets close but it does to much :grin:
Anyhow, @AgentME always cool to see more people working in this space. Roll back a year and no one was interested in this :grimacing:


Docs.MS CI Updates for Azure.Template

CI Update for release of Azure.Template

Docs Build status updates of commit ebe32c3:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

bundlepackages/azure-dotnet-preview.csv
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching in the Docs contributor and Admin GuideSee the frequently asked questionsPost your question in the Docs support channel


add test, and a kind of fix demo

reproduce #30, but is not a fix for all use case.
I suggest to always escape all column names in generated SQL statments ?!

@mmouterde You must not used  reserved words as column name. jeep-sqlite is used as the web part of the @capacitor-community/sqlite and cannot be modify without doing the same modifications in the native part of the plugin. I will reject this pull request

Native parts already support such column name

@mmouterde i will test it and if native platforms support it i will take your PR for the next release

@mmouterde This does not work in any of the Native platforms. So you must not use reserved words. This issue is definitively closed.

This does not work in any of the Native platforms.

Sorry, my bad. I commented the table that has index column to explore further with keep-sqlite... So android/ios did not crash...

Can you give me the table schema so i can test on what you have

Hum, I'm confuse, I'm not sure to have been clear in my last message, I agreed with you assertion.
As you said : Android implementation does not support reserved world too.
Anyway here it is :
CREATE TABLE IF NOT EXISTS bundles (
      id TEXT PRIMARY KEY NOT NULL,
      projectId TEXT,
      name TEXT,
      "index" INTEGER,
      last_modified INTEGER DEFAULT (strftime('%s', 'now')),
      sql_deleted INTEGER DEFAULT 0 CHECK (sql_deleted IN (0, 1))
    );


⚠ ClamAV has degraded performance

In 2f268ce, ClamAV (https://spamassassin.apache.org/) experienced degraded performance:

HTTP code: 200
Response time: 73 ms

Resolved: ClamAV performance has improved in 6c8a69c.


Fix scan unsupported workflow in SQl DB

What changed?

Fix the result ordering of SQL
Fix version histories deserialization

Why?

How did you test it?
Local testing

Potential risks

Coverage increased (+0.02%) to 61.451% when pulling 126ef069d37c57820e96908437152a8f1b401823 on scan_db into ac905302d9427ef9803e590518af984f4f13b266 on master.

Coverage increased (+0.02%) to 61.451% when pulling 126ef069d37c57820e96908437152a8f1b401823 on scan_db into ac905302d9427ef9803e590518af984f4f13b266 on master.

Can we add some comment for the new contract of list executions?
Added comments about the behavior.

It looks like minUUID is also used by ListTaskList, will it cause the same issue there?

I think so. Added a comment on this API. This API is only used in Scanner.

Can we add some comment for the new contract of list executions?
Added comments about the behavior.

It looks like minUUID is also used by ListTaskList, will it cause the same issue there?

I think so. Added a comment on this API. This API is only used in Scanner.


Library using

Hi guys.
Because I have done firstly this library as a private project, I would like to know if someone of you use my library in your application. If yes, please send me a name of your app and link to Play Store and I will promote your app in Readme. Thanks :)

Hello!
Thank you for developing such an awesome SearchView. I have replaced my old one and implemented your library into my app: BCReader

Thanks. Your app is now in README. And next version 3.0 is coming this or next month.

Great! Looking forward to it!

thanks for library
https://play.google.com/store/apps/details?id=org.super8.lastbastion

Awesome app ;). I will add it in Readme.


Nmake 'Dependents' link points to a wrong description

It should point to relevant description of nmake dependents, but points to dumpbin /dependents option instead.

ID: 994aee97-7c77-b074-c966-0d6a4b47d093
Version Independent ID: 52253d9f-148c-7586-7d44-25b2ba13b6c1
Content: Description Blocks
Content Source: docs/build/reference/description-blocks.md
Product: visual-cpp
Technology: cpp-tools
GitHub Login: @corob-msft
Microsoft Alias: corob

The documentation has been updated in the repo we publish from, but changes to the website may not happen until next Monday, due to an embargo for the Ignite conference.


ec2-amis: 2020-11-23 update

Motivation for this change
Things done

[ ] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
Built on platform(s)

[ ] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

I wonder how to best extend this data structure to include aarch64 AMIs? Here are some:
  "eu-west-1.aarch64-linux": "ami-00a02608ff45ff8f9",
  "eu-west-2.aarch64-linux": "ami-0e991d0f8dca21e20",
  "eu-west-3.aarch64-linux": "ami-0d18eec4dc48c6f3b",
  "eu-central-1.aarch64-linux": "ami-01691f25d08f48c9e",
  "eu-north-1.aarch64-linux": "ami-09bb5aabe567ec6f4",
  "us-east-1.aarch64-linux": "ami-0504bd006f9eaae42",
  "us-east-2.aarch64-linux": "ami-00f0f8f2ab2d695ad",
  "us-west-1.aarch64-linux": "ami-02d147d2cb992f878",
  "us-west-2.aarch64-linux": "ami-07f40006cf4d4820e",
  "ca-central-1.aarch64-linux": "ami-0e5f563919a987894",
  "ap-southeast-1.aarch64-linux": "ami-083e35d1acecae5c1",
  "ap-southeast-2.aarch64-linux": "ami-052cdc008b245b067",
  "ap-northeast-1.aarch64-linux": "ami-05e137f373bd72c0c",
  "ap-northeast-2.aarch64-linux": "ami-020791fe4c32f851a",
  "ap-south-1.aarch64-linux": "ami-0285bb96a0f2c3955",
  "ap-east-1.aarch64-linux": "ami-0d61fd8aff0c94314",
  "sa-east-1.aarch64-linux": "ami-0a55ab650c32be058"

maybe it could look like this:
{
  "20.09".eu-west-1.x86_64.hvm-ebs = "ami-0057cb7d614329fa2";
  "20.09".eu-west-1.hvm-ebs = "ami-0057cb7d614329fa2"; # backwards compatibility
  "20.09".eu-west-2.x86_64.hvm-ebs = "ami-0d46f16e0bb0ec8fd";
  "20.09".eu-west-2.hvm-ebs = "ami-0d46f16e0bb0ec8fd"; # backwards compatibility
  "20.09".eu-west-3.x86_64.hvm-ebs = "ami-0e8985c3ea42f87fe";
  "20.09".eu-west-3.hvm-ebs = "ami-0e8985c3ea42f87fe";  # backwards compatibility
  "20.09".eu-west-1.arm64 = "ami-00a02608ff45ff8f9";
  "20.09".eu-west-2.arm64 = "ami-0e991d0f8dca21e20",
  "20.09".eu-west-3.arm64 = "ami-0d18eec4dc48c6f3b",
}


fix: semgrep not available on Aarch64 MacOS

Why merge master into this branch?

No idea how this happened...

Oh. I've pushed the update in the UI. I see. We should maybe remove the "merge" option. We never want to use it, as we don't seem to care about preserving the signed commits or anything like that.


Refresh Timer doesnt work for some reason

It's probably best to remake it in the RenderScheduler

It does now apparently


current config uses sqlite in dev beanstalk env

This happens even when YO_DB_URL is defined
INFO:yo.db:Using sqlite engine for database storage

Fix in PR:
https://github.com/steemit/yo/pull/38
Please review and merge

Closing this as it appears fixed, if i'm incorrect please reopen or file a new issue

still not working: `INFO:yo.db:Using sqlite engine for database storage``

Only use DB_URL
The goal is that sqlite is only used in EB if someone explicitly sets the DB_URL to sqlite://:memory: It should never happen if an env var is unset or set with a typo.
This means removing the sqlite and mysql sections from yo.cfg


Without using it, it's -insecure, you can't use it

refer to https://www.unknowncheats.me/forum/counterstrike-global-offensive/404018-cs-start-blocking-unsigned-dlls.html


Add documentation about getting a message in a nested directory

We need to add into README file a documentation section or note on how to get a message that originally was in a nested directory (that's using the /). For example:
Lang.get('forum/thread.hello')

The documentation should be added inside the code block here: https://github.com/rmariuzzo/Lang.js#get

I'll do it!

Fixed by #52

If Im using Lang.get('forum/thread.hello'), JS/VUE convert me this to forum.thread.hello, if I put two slashes gives me two dots ...
If I refer to lang file placed directly in main Laravel lang directory package works perfectly :(


The link "Example F# Webjob" is broken.

The link to F# Webjob(https://github.com/andredublin/fsharp-azure-webjob) is broken. Suggest to update to this https://github.com/jrr/webjob-project-examples.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 45bbacb9-52da-4b4e-1c68-2e582aab477d
Version Independent ID: 9aa1c6f5-a9cc-3a51-7f02-36da483f0c4a
Content: Using F# on Azure
Content Source: docs/fsharp/using-fsharp-on-azure/index.md
Product: dotnet-fsharp
GitHub Login: @sylvanc
Microsoft Alias: phcart

@cartermp can you please take a look at this feedback?


Calendar to display

How do you select a calendar, it just says Loading... and never loads. I am hosting it on Dreamhost. Great work btw... exactly what I was looking for... a Dakboard replacement.

Well, there should either be a dropdown to select a calendar, or a button that lets you authorize your Google account.  But after looking at the code, it looks like I forgot to pull over the 'authorize' button functionality when I migrated to create-react-app and ES2015.
Let me see if I can add that in easily in the near future.
Thanks for the reference to Dakboard - I didn't realize that product existed.  👍

Added the auth button back if there is an authorization failure when getting calendars.  In testing, I discovered you might need to refresh the web app (ctrl-F5) after authorizing with Google.  That seems like a bug -- let me know if you needed to do that too.

Does the button eventually display -- or does it just stay on 'loading' for more than 30 seconds?

the button never displays.
On Wed, Mar 28, 2018, 1:50 PM Dan Esparza<EMAIL_ADDRESS>wrote:

Does the button eventually display -- or does it just stay on 'loading'
for more than 30 seconds?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/danesparza/Dashboard/issues/4#issuecomment-376995918,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AM6sx7DfRYLCmaUl7niPt9_4V86kC1DCks5ti9t9gaJpZM4S9OQi
.

Thanks @ragincajunintx -- by any chance, can you try this in Chrome and show me what's in your developer console when this happens?

hi @danesparza i'm having the same problem with chrome on OS X right now. the "authorize" button does appear in safari just fine.

@mrtaco00 I have a suspicion:  Are you attempting to load this on a non-HTTPS site?  If you can, try loading this on an HTTPS based site and tell me if you have a different result.  I suspect this is caused by browser restrictions on non-HTTPS cross-domain requests.

sorry for the delay in replying!  I tried running via https (HTTPS=true
yarn start --ssl), but saw the same behavior
The only error I see in the console is in SettingsUtils.js:32
There was a problem reading the cookie:  SyntaxError: Unexpected token u in
JSON at position 0
at Object.parse ()
at SettingsUtils.getSettings (SettingsUtils.js:27)
at Object.success (index.js:33)
at LocationAPIUtils.js:32
[image: image.png]
On Thu, Jun 14, 2018 at 2:13 PM Dan Esparza<EMAIL_ADDRESS>wrote:

@mrtaco00 https://github.com/mrtaco00 I have a suspicion: Are you
attempting to load this on a non-HTTPS site? If you can, try loading this
on an HTTPS based site and tell me if you have a different result. I
suspect this is caused by browser restrictions on non-HTTPS cross-domain
requests.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/danesparza/Dashboard/issues/4#issuecomment-397389244,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG7AAfG96qQYjdkI_1Q4KrVNCO6gjMyeks5t8qfVgaJpZM4S9OQi
.


Stg types containing Accounts have broken Deserialization

Currently typetag first issue is: "Deserialization of generic impls is not supported yet"
This makes it so that Stg types containing Accounts can't be Deserialized as Account<N, K, V> contains generic impls.
This doesn't break compatibility in any way as with the "serde" feature off you can't Deserialize Stg containing Account and with it on you can't either.
This just affects the specific use case of Deserialization of Stg containing Account (and Account's containing Stg containing Account), a specific use case that I don't believe is common.

Also important to note that the same issue is what prevents writing
impl<T: ...> Setting for T {}


[lexical-playground] Bug: Hidden formatting options in text selection on narrow screens or vertical monitors

Lexical version: 0.20.0
The formatting options are present when the browser window is in the normal aspect ratio

The formatting options are hidden when the browser window is in narrow/vertical aspect ratios

Was this the intended behaviour?

Yes, search for isSmallWidthViewport in the code to see which plugins are disabled on narrower windows. It might make sense to have different widths for each plugin, but that is currently working as designed.

the formatting <FloatingTextFormatToolbarPlugin/> and its attached plugins inside the viewport that are restricted to certain views coz the format bar at the top contains the necessary format options already... my bad, silly me .
but the comment option at the side might be needed #6859


WordBazaar - Token does not appear after creation

Users should be informed about the standard delay for the newly created token to appear in the list. Or else the user may think something went wrong.
Alternatively, an optimistic rendering approach could be beneficial for this scenario.

cc @thepiwo @onvisions

cc @thepiwo @onvisions

what commit version are you using, were there any errors in the console?

what commit version are you using, were there any errors in the console?

https://prototype-word-bazzar.aggregator.z52da5wt.xyz/wordbazaar
Some errors were thrown throughout the creation process, though they don't seem to be related:

https://prototype-word-bazzar.aggregator.z52da5wt.xyz/wordbazaar
Some errors were thrown throughout the creation process, though they don't seem to be related:

I think this issue is resolved already, it was caused by using different testing registry contract.


Analyzer crash: The getter 'isBottom' was called on null

Exception from analysis server (running from VSCode / Dart Code)
What I was doing
I was writing a new regression test and was just typing out the line to instantiate testBed (note the line was incomplete when the analyzer crashed - while TestComponent is also a type, I was actually in the process of writing TestComponentNgFactory):
@TestOn('browser')
import 'package:angular/angular.dart';
import 'package:angular_test/angular_test.dart';
import 'package:test/test.dart';

import '1382_ng_template_outlet_test.template.dart' as ng;

void main() {
  test('', () async {
    final testBed = NgTestBed.forComponent(ng.TestComponent)
  });
}

@Component(
  selector: 'test',
  template: '''
    <template></template>
    <ng-container *ngTemplateOutlet=""></ng-container>
  ''',
  directives: const [NgTemplateOutlet],
)
class TestComponent {
  @ViewChild('')
  TemplateRef templateRef;
}

Versions

Dart SDK 2.0.0-dev.59.0
Visual Studio Code 1.23.1
Dart Code 2.13.1

Analyzer Info
The analyzer was launched using the arguments:
/usr/local/Cellar/dart/2.0.0-dev.59.0/libexec/bin/snapshots/analysis_server.dart.snapshot
--client-id=Dart-Code.dart-code
--client-version=2.13.1

Exception
Analysis failed: /<path-to-repo>/angular/_tests/test/regression/1382_ng_template_outlet_test.dart context: exception_20180605_190641_530
NoSuchMethodError: The getter 'isBottom' was called on null.
Receiver: null
Tried calling: isBottom
#0      Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)
#1      _isBottom (package:analyzer/src/generated/type_system.dart:52)
#2      GenericInferrer._matchSubtypeOf (package:analyzer/src/generated/type_system.dart:640)
#3      GenericInferrer.tryMatchSubtypeOf (package:analyzer/src/generated/type_system.dart:257)
#4      GenericInferrer.constrainArgument (package:analyzer/src/generated/type_system.dart:118)
#5      StrongTypeSystemImpl.inferGenericFunctionOrType (package:analyzer/src/generated/type_system.dart:937)
#6      StaticTypeAnalyzer._inferGenericInvoke (package:analyzer/src/generated/static_type_analyzer.dart:2010)
#7      StaticTypeAnalyzer._inferGenericInvocationExpression (package:analyzer/src/generated/static_type_analyzer.dart:1968)
#8      StaticTypeAnalyzer.visitMethodInvocation (package:analyzer/src/generated/static_type_analyzer.dart:851)
#9      MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7871)
#10     ResolverVisitor.visitMethodInvocation (package:analyzer/src/generated/resolver.dart:6229)
#11     MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7871)
#12     VariableDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:11346)
#13     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#14     UnifyingAstVisitor.visitVariableDeclaration (package:analyzer/dart/ast/visitor.dart:3224)
#15     ScopedVisitor.visitVariableDeclaration (package:analyzer/src/generated/resolver.dart:7841)
#16     ResolverVisitor.visitVariableDeclaration (package:analyzer/src/generated/resolver.dart:6385)
#17     VariableDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:11340)
#18     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:8263)
#19     VariableDeclarationListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:11442)
#20     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#21     UnifyingAstVisitor.visitVariableDeclarationList (package:analyzer/dart/ast/visitor.dart:3228)
#22     ResolverVisitor.visitVariableDeclarationList (package:analyzer/src/generated/resolver.dart:6409)
#23     VariableDeclarationListImpl.accept (package:analyzer/src/dart/ast/ast.dart:11436)
#24     VariableDeclarationStatementImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:11497)
#25     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#26     UnifyingAstVisitor.visitVariableDeclarationStatement (package:analyzer/dart/ast/visitor.dart:3232)
#27     VariableDeclarationStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:11493)
#28     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:8263)
#29     BlockImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1353)
#30     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#31     UnifyingAstVisitor.visitBlock (package:analyzer/dart/ast/visitor.dart:2919)
#32     ScopedVisitor.visitBlock (package:analyzer/src/generated/resolver.dart:7276)
#33     BlockImpl.accept (package:analyzer/src/dart/ast/ast.dart:1349)
#34     BlockFunctionBodyImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1298)
#35     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#36     UnifyingAstVisitor.visitBlockFunctionBody (package:analyzer/dart/ast/visitor.dart:2922)
#37     ScopedVisitor.visitBlockFunctionBody (package:analyzer/src/generated/resolver.dart:7288)
#38     ResolverVisitor.visitBlockFunctionBody (package:analyzer/src/generated/resolver.dart:5508)
#39     BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1294)
#40     FunctionExpressionImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:5440)
#41     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#42     UnifyingAstVisitor.visitFunctionExpression (package:analyzer/dart/ast/visitor.dart:3033)
#43     ScopedVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:7616)
#44     ResolverVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:6008)
#45     FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5434)
#46     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:8263)
#47     ArgumentListImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:432)
#48     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#49     UnifyingAstVisitor.visitArgumentList (package:analyzer/dart/ast/visitor.dart:2898)
#50     ResolverVisitor.visitArgumentList (package:analyzer/src/generated/resolver.dart:5383)
#51     ArgumentListImpl.accept (package:analyzer/src/dart/ast/ast.dart:428)
#52     ResolverVisitor.visitMethodInvocation (package:analyzer/src/generated/resolver.dart:6228)
#53     MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:7871)
#54     ExpressionStatementImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:4325)
#55     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#56     UnifyingAstVisitor.visitExpressionStatement (package:analyzer/dart/ast/visitor.dart:3005)
#57     ExpressionStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:4321)
#58     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:8263)
#59     BlockImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1353)
#60     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#61     UnifyingAstVisitor.visitBlock (package:analyzer/dart/ast/visitor.dart:2919)
#62     ScopedVisitor.visitBlock (package:analyzer/src/generated/resolver.dart:7276)
#63     BlockImpl.accept (package:analyzer/src/dart/ast/ast.dart:1349)
#64     BlockFunctionBodyImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:1298)
#65     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#66     UnifyingAstVisitor.visitBlockFunctionBody (package:analyzer/dart/ast/visitor.dart:2922)
#67     ScopedVisitor.visitBlockFunctionBody (package:analyzer/src/generated/resolver.dart:7288)
#68     ResolverVisitor.visitBlockFunctionBody (package:analyzer/src/generated/resolver.dart:5508)
#69     BlockFunctionBodyImpl.accept (package:analyzer/src/dart/ast/ast.dart:1294)
#70     FunctionExpressionImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:5440)
#71     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#72     UnifyingAstVisitor.visitFunctionExpression (package:analyzer/dart/ast/visitor.dart:3033)
#73     ScopedVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:7591)
#74     ResolverVisitor.visitFunctionExpression (package:analyzer/src/generated/resolver.dart:6008)
#75     FunctionExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:5434)
#76     FunctionDeclarationImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:5284)
#77     ResolverVisitor.visitNode (package:analyzer/src/generated/resolver.dart:6241)
#78     UnifyingAstVisitor.visitFunctionDeclaration (package:analyzer/dart/ast/visitor.dart:3026)
#79     ScopedVisitor.visitFunctionDeclarationInScope (package:analyzer/src/generated/resolver.dart:7584)
#80     ResolverVisitor.visitFunctionDeclarationInScope (package:analyzer/src/generated/resolver.dart:5984)
#81     ScopedVisitor.visitFunctionDeclaration (package:analyzer/src/generated/resolver.dart:7576)
#82     ResolverVisitor.visitFunctionDeclaration (package:analyzer/src/generated/resolver.dart:5974)
#83     FunctionDeclarationImpl.accept (package:analyzer/src/dart/ast/ast.dart:5277)
#84     ResolverVisitor.visitCompilationUnit (package:analyzer/src/generated/resolver.dart:5613)
#85     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2504)
#86     LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:710)
#87     LibraryAnalyzer._analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:129)
#88     _HashVMBase&MapMixin&&_LinkedHashMapMixin.forEach (dart:collection-patch/dart:collection/compact_hash.dart:363)
#89     LibraryAnalyzer._analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:128)
#90     LibraryAnalyzer.analyze.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:103)
<asynchronous suspension>
#91     _PerformanceTagImpl.makeCurrentWhileAsync (package:analyzer/src/generated/utilities_general.dart:220)
<asynchronous suspension>
#92     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:99)
<asynchronous suspension>
#93     AnalysisDriver._computeAnalysisResult.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1264)
<asynchronous suspension>
#94     PerformanceLog.runAsync (package:front_end/src/base/performance_logger.dart:52)
<asynchronous suspension>
#95     AnalysisDriver._computeAnalysisResult (package:analyzer/src/dart/analysis/driver.dart:1223)
<asynchronous suspension>
#96     AnalysisDriver.performWork (package:analyzer/src/dart/analysis/driver.dart:1028)
<asynchronous suspension>
#97     AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:1974)
<asynchronous suspension>
#98     AnalysisDriverScheduler.start (package:analyzer/src/dart/analysis/driver.dart:1917)
#99     new AnalysisServer (package:analysis_server/src/analysis_server.dart:395)
#100    SocketServer.createAnalysisServer (package:analysis_server/src/socket_server.dart:79)
#101    StdioAnalysisServer.serveStdio (package:analysis_server/src/server/stdio_server.dart:37)
#102    Driver.start.<anonymous closure> (package:analysis_server/src/server/driver.dart:435)
#103    _rootRun (dart:async/zone.dart:1126)
#104    _CustomZone.run (dart:async/zone.dart:1023)
#105    runZoned (dart:async/zone.dart:1501)
#106    Driver._captureExceptions (package:analysis_server/src/server/driver.dart:475)
#107    Driver.start (package:analysis_server/src/server/driver.dart:434)
#108    main (file:///b/build/slave/dart-sdk-mac-dev/build/sdk/pkg/analysis_server/bin/server.dart:12)
#109    _startIsolate.<anonymous closure> (dart:isolate-patch/dart:isolate/isolate_patch.dart:277)
#110    _RawReceivePortImpl._handleMessage (dart:isolate-patch/dart:isolate/isolate_patch.dart:165)

Diagnostics requested after the error occurred are:
[
    {
        "name": "/<path-to-repo>/angular/angular_compiler",
        "explicitFileCount": 35,
        "implicitFileCount": 1060,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular",
        "explicitFileCount": 0,
        "implicitFileCount": 0,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/angular_forms",
        "explicitFileCount": 41,
        "implicitFileCount": 570,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/angular",
        "explicitFileCount": 181,
        "implicitFileCount": 1014,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/angular_ast",
        "explicitFileCount": 63,
        "implicitFileCount": 885,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/examples/hello_world",
        "explicitFileCount": 1,
        "implicitFileCount": 283,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/examples/hacker_news_pwa",
        "explicitFileCount": 10,
        "implicitFileCount": 458,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/angular_router",
        "explicitFileCount": 36,
        "implicitFileCount": 567,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/dev",
        "explicitFileCount": 10,
        "implicitFileCount": 428,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/examples/github_issues",
        "explicitFileCount": 6,
        "implicitFileCount": 1258,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/_benchmarks",
        "explicitFileCount": 17,
        "implicitFileCount": 563,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/angular/tools/analyzer_plugin",
        "explicitFileCount": 1,
        "implicitFileCount": 859,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/examples/registration_form",
        "explicitFileCount": 3,
        "implicitFileCount": 504,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/angular_test",
        "explicitFileCount": 17,
        "implicitFileCount": 550,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/_goldens",
        "explicitFileCount": 39,
        "implicitFileCount": 1446,
        "workItemQueueLength": 0,
        "cacheEntryExceptions": []
    },
    {
        "name": "/<path-to-repo>/angular/_tests",
        "explicitFileCount": 112,
        "implicitFileCount": 2373,
        "workItemQueueLength": 2,
        "cacheEntryExceptions": []
    }
]

@stereotype441 Is this something that you could look at?

@bwilkerson Judging by the stacktrace, it looks like the analzer was trying to perform type inference on NgTestBed.forComponent(ng.TestComponent), in order to infer the proper generic parameter for the call to the static method NgTestBed.forComponent, and for some reason the .staticType getter of ng.TestComponent returned null.
note: NgTestBed.forComponent is a static generic method defined here: https://github.com/dart-lang/angular/blob/34c31cef2c2e46da63e9bd957757a706bd8a0b4f/angular_test/lib/src/frontend/bed.dart#L147
My plate's rather full at the moment, so I'm not sure when I'll be able to dig further into this.

I just hit this same crash again. Here's the source I was writing:
import 'package:angular/angular.dart';

// ignore: uri_has_not_been_generated
import 'package:path_to_regexp_demo/app_component.template.dart' as app_template;

void main() {
  runApp(app_template.)
}

I seem to hit this every time I start writing a new file that imports generated source via a prefix. The crash occurs right after I type the '.' after the prefix.

I tried to reproduce the behavior on bleeding edge using the example above, but it did not generate an exception. It's likely that my project is not configured the way your is, but I wouldn't have expected that to be a determining factor. It's possible that the bug has been fixed on the bleeding edge, but I can't know for sure.

Alright, I'll wait until the next SDK update. If this continues to occur after that I'll put together a reproduction that I can share.

Thanks!

closing as likely stale


Need to replace fixed-size event array with a list

Currently we limit the number of events to be 50 as defined in evlist.h:
#define MAX_EVENTS  50
...
typedef struct evlist_t {
  char evl_spec[MAX_EVL_SIZE];
  int nevents;
  _ev_t events[MAX_EVENTS];
} evlist_t;

It's better to have a more flexible data structure such as linked list so that the number can exceed the limitation.

This repository has moved to GitLab, please continue this issue there.


No reproducible using tensorflow backend

with theano backend (CPU or GPU without cnDNN), I could train reproducible model by
fixed_seed_num = 1234
nunpy.random.seed(fixed_seed_num)
random.seed(fixed_seed_num) # not sure if needed or not

While in pure tensorflow without keras wrapper, it could also be reproducible by
tersorflow.set_random_seed(fixed_seed_num)

Don't know why, but in Keras + tensorflow backend, non of the above could give reproducible training model.
Environment:

Keras: v0.3.2
tensorflow: v0.7.1
Macbook OS X v10.11.4
tensorflow is using CPU

BTW: it would be great if keras could expose an unified API for reproducible training. something like:
keras.set_random_seed(fixed_seed_num)

BTW: it would be great if keras could expose an unified API for reproducible training

Right. I will look into it. Or does anybody else want to take a look at it?

Is there any update on this?
I could train reproducible models on theano (setting the seed before the keras import #439), but not when using the tensorflow backend.
related: #850

I run into this problem in edward, here is fix we went with after rather long discussion: https://github.com/blei-lab/edward/pull/184. Long story short - it is pretty hard to seed tensorflow if you have single shared session. Would be very interested to hear if there is a better solution :)

Any update on this?

Correct me if I'm wrong, but looks like this issue is still open and there is no way currently in Keras with a TensorFlow backend to get reproducible results.  Any update? Workaround?

Well, there is this solution https://github.com/blei-lab/edward/pull/184, I can propose PR with that to Keras if that makes sense, @fchollet ?

Any news on that issue? @bluelight773 I think when running it on the CPU it's reproducible - but's not really an option most of the time

Maybe there is a work around by programming use both Keras and Tensorflow following this post:
https://blog.keras.io/keras-as-a-simplified-interface-to-tensorflow-tutorial.html
Use Keras pre-defined model to speed up building your model. But use Tensorflow for input, output and optimization.
Take a look at this code, it seems could reproduce the result. If you use
import numpy as np
np.random.seed(42)
import tensorflow as tf
tf.set_random_seed(42)

Different behaviors during training and testing

Some Keras layers (e.g. Dropout, BatchNormalization) behave differently at training time and testing time.
You can tell whether a layer uses the "learning phase" (train/test) by printing layer.uses_learning_phase,
a boolean: True if the layer has a different behavior in training mode and test mode, False otherwise.

If your model includes such layers, then you need to specify the value of the learning phase as part of feed_dict,
so that your model knows whether to apply dropout/etc or not.

To make use of the learning phase, simply pass the value "1" (training mode) or "0" (test mode) to feed_dict:
"""
import numpy as np
np.random.seed(42)
import tensorflow as tf
tf.set_random_seed(42)
sess = tf.Session()
from keras.layers import Dropout, Dense, LSTM
from keras import backend as K
K.set_session(sess)
from keras.objectives import categorical_crossentropy
from keras.metrics import categorical_accuracy as accuracy

# load data
from tensorflow.examples.tutorials.mnist import input_data
mnist_data = input_data.read_data_sets('MNIST_data', one_hot=True)

img = tf.placeholder(tf.float32, shape=(None, 784))
labels = tf.placeholder(tf.float32, shape=(None, 10))

x = Dense(128, activation='relu')(img)
x = Dropout(0.5)(x)
x = Dense(128, activation='relu')(x)
x = Dropout(0.5)(x)
preds = Dense(10, activation='softmax')(x)

loss = tf.reduce_mean(categorical_crossentropy(labels, preds))

# train_step = tf.train.GradientDescentOptimizer(0.5).minimize(loss)
train_step = tf.train.RMSPropOptimizer(learning_rate=0.001).minimize(loss)
# train_step = tf.train.AdagradOptimizer(learning_rate=0.001).minimize(loss)
# train_step = tf.train.AdadeltaOptimizer(learning_rate=0.001).minimize(loss)

with sess.as_default():
    sess.run(tf.global_variables_initializer())
    for i in range(100):
        batch = mnist_data.train.next_batch(50)
        train_step.run(feed_dict={img: batch[0],
                                  labels: batch[1],
                                  K.learning_phase(): 1})

acc_value = accuracy(labels, preds)
with sess.as_default():
    print acc_value.eval(feed_dict={img: mnist_data.test.images,
                                    labels: mnist_data.test.labels,
                                    K.learning_phase(): 0})```

I heard that Keras is going to be merged in TensorFlow. Can I expect that the problem of reproducibility is solved at the same time? If YES, it will be great improvement for Kaggle usage!

@nejumi, ditto. This lack of support makes it really hard to run experiments with Keras & TF. I appreciate the convos and solutions here but really hoping this gets fixed soon.

With theano it is possible to ensure reproducibility of cuDNN by setting dnn.conv flags:
https://github.com/fchollet/keras/issues/2479#issuecomment-213987747
With tensorflow, how do we set those flags?

For some time, I had at least reproducible results when running the training on the CPU. However even that seems not to work any more. Anyone experienced the same?

I'm looking for a way of reproducing keras code, but I'm supposing that it's not possible. Am I right?

It is possible, see my comment above

Thanks @diogoff but my problem is that I have tensorflow as backend and also I utilize cuDNN. It's the case that you are looking too for a solution.

I gave up on reproducibility because I found that when forcing deterministic behavior in cuDNN, training would be much slower (e.g. from 15 secs/epoch to 30 secs/epoch).

IMO this is a critical issue that merits a high priority.  Running a complex model for several minutes is meaningless unless its results can be reproduced.
Can we confirm the latest suggestion works for TensorFlow?
import numpy as np
np.random.seed(42)
import tensorflow as tf
tf.set_random_seed(42)

@pylang are you using cuDNN?

@diogoff I have not taken extra steps to install cuDNN.  My assumption is no, though I am unaware how verify this absolutely.

Try:
$ ls -las /usr/local/cuda/include/*dnn*
and
$ ls -las /usr/local/cuda/lib64/*dnn*
If you see libcudnn.so installed, you have it and probably tensorflow is using it.
If I remember, tensorflow will print some warning/info messages on startup, saying which libraries it has loaded. On my system, libcudnn.so was one of them.

I searched all files on my Windows machine and found none by that name, nor any system files with "cudnn" (only folders included in Anaconda's TensorFlow site package).  I also don't see any warnings aside from the "TensorFlow backend" warning upon import.  Seeing that
I have not directly installed the driver, find no library files under this name, and see no unusual warnings at import, I conclude I do not have cudnn installed.

On another note ... I perceived the main issue with non-reproducible results in keras may be related to how the weights are randomized for each call.
I did discover (late last night), that the kernel_initializer has a number of options for setting up a distribution from which (I assume) the weights are drawn.   I have not run substantial tests to make a conclusion nor investigated these options further yet, but my initial tests seem to suggest that selecting a a different initializer influences the reproducibility.  The default initializer is called "glorot_uniform".  I played with some other distributions and managed to get more reproducible results, although with much higher error.
Perhaps we should post a simple example, e.g. single Dense layer, 1 input linear regression, and assess it's reproducibility for different users.

I picked up mnist_cnn.py from the examples and set up keras.json in this way:
{
    "image_data_format": "channels_first",
    "epsilon": 1e-07,
    "floatx": "float32",
    "backend": "tensorflow"
}

I ran python mnist_cnn.py a couple of times and the results did not seem to be reproducible.
Then I edited mnist_cnn.py and inserted the following code between from __future__ import print_function (line 8) and import keras (line 9):
import numpy as np
np.random.seed(123)
import tensorflow as tf
tf.set_random_seed(123)

The results now look sufficiently reproducible to me. The small differences I assume are due to the use of cuDNN.
I tried running without cuDNN:
$ TF_USE_CUDNN=0 python mnist_cnn.py
but it seems it's not possible:
UnimplementedError (see above for traceback): Conv2D for GPU is not currently supported without cudnn

If I switch the backend to Theano:
{
    "image_data_format": "channels_first",
    "epsilon": 1e-07,
    "floatx": "float32",
    "backend": "theano"
}

and insert the following code between lines 8-9 in mnist_cnn.py:
import numpy as np
np.random.seed(123)

and then run:
$ THEANO_FLAGS="dnn.conv.algo_bwd_filter=deterministic,dnn.conv.algo_bwd_data=deterministic" python mnist_cnn.py
the results are fully reproducible.

@diogoff for clarity, what do you consider fully reproducible?  Do you know how close your loss results between runs?  I'd like to compare notes.

With fully reproducible, I mean I always get exactly the same results in every run:
loss: 0.3336 - acc: 0.8981 - val_loss: 0.0788 - val_acc: 0.9759
loss: 0.1214 - acc: 0.9642 - val_loss: 0.0548 - val_acc: 0.9828
loss: 0.0893 - acc: 0.9733 - val_loss: 0.0443 - val_acc: 0.9847
loss: 0.0735 - acc: 0.9783 - val_loss: 0.0391 - val_acc: 0.9871
loss: 0.0666 - acc: 0.9804 - val_loss: 0.0363 - val_acc: 0.9872
loss: 0.0590 - acc: 0.9825 - val_loss: 0.0369 - val_acc: 0.9873
loss: 0.0542 - acc: 0.9836 - val_loss: 0.0338 - val_acc: 0.9889
loss: 0.0505 - acc: 0.9850 - val_loss: 0.0314 - val_acc: 0.9889
loss: 0.0467 - acc: 0.9861 - val_loss: 0.0299 - val_acc: 0.9896
loss: 0.0451 - acc: 0.9867 - val_loss: 0.0319 - val_acc: 0.9898
loss: 0.0421 - acc: 0.9874 - val_loss: 0.0297 - val_acc: 0.9894
loss: 0.0405 - acc: 0.9880 - val_loss: 0.0309 - val_acc: 0.9895
Test loss: 0.0309449151449    <-- exactly the same up to the last digit
Test accuracy: 0.9895

Keras 2.0.2, Theano 0.9.0, CUDA 8.0, cuDNN 5110 (libcudnn.so.5.1.10)

I have the same issue when using tensorflow on CPU, searched the solution online for 2 days and find this solved my issue: http://stackoverflow.com/questions/42412660/non-deterministic-gradient-computation
The reason for short is tensorflow using multiple threads or core to do the computation, and this would be a hidden issue when rounding the floating value and sharing it amount multiple threads.
To fix this, if you don't care about speed, just limit the thread tf using when creating a session:
sess = tf.Session(config=tf.ConfigProto(inter_op_parallelism_threads=1))

Can anyone solve the reproducibility issue for training recurrent layers?

Is there any update on this issue? I am experiencing it with the simple CIFAR10 example network, running on TF. Properly seeding both numpy.random.seed() and tf.set_random_seed() does not fix the issue. It seems that weight initialization is the same, but the weights diverge as training progresses.
It's going to be difficult to publish results with Keras+TF if the results are not reproducible.

I will focus on this issue.
I got a different value between validation accuracy and evaluation after loaded weights on the same dataset (validation data). So I cannot use the model trained anywhere.

With the solution of @JacobIsrael123 my initialization (and thus the first loss using model.evaluate before fit) is the same. However,  the accuracies and losses differ when fitting.
I am computing only on CPU. I turned shuffle = False in the fit function. Using theano my code produces the same results.

after trying all the above suggestions, the results are NOT reproducible even on cpu for keras+tensorflow.

Is this still open for tensorflow? Any updates from the keras 2.0 changes? Even if there is some kind of workaround, this is important to me. Very hard to debug without determinism.

I am using theano backend (not tensorflow) on GPU, and I can't get reproducible validation loss (using generator) using feed forward neural net. The training loss is reproducible. Fit data generator and the validation data generator are two instances of the same function. Due to this, it is strange that val_loss is non-deterministic. I have set the numpy seed in the beginning of the script. I have tried setting python random seed, pythonhashseed off, and deterministic dnn flags, but no luck. Maybe there is a link between this behavior and non-determinism on tf?

Theano should give reproducible results!!!! Are you getting the same accuracy atleast?

@KiranBaktha Train loss and accuracy are both reproducible, validation loss and accuracy are not

This configuration at the top of the code seems to work for me:
import numpy as np
import tensorflow as tf
import random as rn
np.random.seed(42)
rn.seed(12345)
#single thread
session_conf = tf.ConfigProto(
intra_op_parallelism_threads=1,
inter_op_parallelism_threads=1)
from keras import backend as K
tf.set_random_seed(1234)
sess = tf.Session(graph=tf.get_default_graph(), config=session_conf)
K.set_session(sess)
----ALSO set the shuffle=False in the fit call----
Note:  This config forces single threaded operation.  Allowing multithread seems to cause non-reproducible results.

Doing what @td2014 (except for setting shuffle=False) didn't work, but once I added os.environ['PYTHONHASHSEED'] = '0' in addition to what he suggested, it worked! Setting the
PYTHONHASHSEED environment variable seems necessary for python3.
import numpy as np
import random as rn
import tensorflow as tf
    # Setting PYTHONHASHSEED for determinism was not listed anywhere for TensorFlow,
    # but apparently it is necessary for the Theano backend
    # (https://github.com/fchollet/keras/issues/850)
    # and also caused results to be deterministic for our case,
    # when running on a single CPU thread.
    os.environ['PYTHONHASHSEED'] = '0'
    np.random.seed(7)
    rn.seed(7)

    if should_use_single_cpu_thread:
        # Limit operation to 1 thread for deterministic results.
        session_conf = tf.ConfigProto(
            intra_op_parallelism_threads=1,
            inter_op_parallelism_threads=1
        )

        from keras import backend as K

        tf.set_random_seed(7)
        sess = tf.Session(graph=tf.get_default_graph(), config=session_conf)
        K.set_session(sess)

    from keras.models import load_model

I tried the method suggested by @abali96 to reproduce my keras+TF model in Jupyter notebook. What I observed is that during a kernel's lifetime the training and evaluation can be reproduced.
That is to say, I can open a jupyter notebook, set seeds, fit the model, and the result (and training process) I get can be reproduced if I run the script again from the beginning. When I shutdown the kernel and reopen it, the results I get from the previous kernel cannot be reproduced. If I have several kernels running at the same time, results yielded from kernel A cannot be reproduced in kernel B even if they share exactly the same hyperparameters and seeds.
Anyone has the same problem or has any advice?

I tried @abali96 method but still do not have reproducible results across runs either - each run under a new kernel. My system is configured to use libcudnn.so
>>> keras.__version__
'2.0.4'
>>> tensorflow.__version__
'1.1.0'

I believe this is known, but if I switch my code to use Theano as the backend, I need to set "conv.algo_bwd_data=deterministic" and "conv.algo_bwd_filter=deterministic" to achieve perfect reproducibility. I think there needs to be an equivalent option in Tensorflow, but I am not sure if there is one. If this is where the problem is coming from, then it isn't necessarily a Keras issue.

I wonder if anyone solved this by trying tensorflow 1.3 with cudnn 6 ?

I am using keras with tensorflow backend. I have to use Tensorflow only, cant change to Teano backend. I am creating a simple 1 layer LSTM model. I need my code to give same val_loss every time I train on the same data. I am running my system on CPU only. I tried:
from numpy.random import seed
seed(1337)
from tensorflow import set_random_seed
set_random_seed(1337)
on the top of my code.
I also initialized all the kernels and recurrent as ones:
model.add(LSTM(150,input_shape=(None,124), W_regularizer=l2(0.001),kernel_initializer='ones', recurrent_initializer='ones', bias_initializer='ones'))
model.add(Dense(2,kernel_initializer='ones', bias_initializer='ones'))
model.add(Activation("softmax"))
I also set shuffle=False in model.fit(). I am using rms for optimizing.
I also set PYTHONHASHSEED to 0. But still I am getting different train loss as well as val loss on each epoch when rum multiple times.
I am running keras on a server with 56 cpu cores and CentOS.
Pls help soon as I have tried everything everyone has suggested in other threads !!!!!

+1

I've tested this toy script on both Ubuntu (with a GeForce GTX 1080 ti GPU) and a Macbook Pro (cpu only). While the least significant digits of the loss values differ across platforms the accuracy is consistent. I've run the script 10 times in a row on both platforms and see the same results each time.
The Ubuntu machine is running:
$ conda list | grep -i cud
cudatoolkit               8.0                           1
cudnn                     6.0.21                cuda8.0_0
tensorflow-gpu            1.2.1           py36cuda8.0cudnn6.0_0

Both machines are running:
$ python -V
Python 3.6.2 :: Anaconda custom

Here is the output from my Ubuntu machine. Here is the output from OS X.
I'm happy to try out other tests/suggestions if it would be helpful.

Tensorflow is completely useless because of that issue. What's the reason to train models if you can't compare their performance because it's not reproducible?

Official answer to the question: "How can I obtain reproducible results using Keras during development?" - https://keras.io/getting-started/faq/ But it just doesn't work!

I also had a very similar if not the same one with TF backend. It was quite severe because perhaps partly due to my relatively small-sized model and dataset, the performance at the end significantly varied. I tried fixing tensorflow random seed, fixed init (later even with a pickled file for init weights), getting the same data sample provided, but still ended up different results. Seems like tensorflow's multithreading steps in somehow, since turning off the multiple thread of TF 'somehow' worked, not completely though (say, in a repeated experiment, 2/4 happened to be identical).
Moved to Theano, passed the THEANO flags that @diogoff mentioned ($ THEANO_FLAGS="dnn.conv.algo_bwd_filter=deterministic,dnn.conv.algo_bwd_data=deterministic" python mnist_cnn.py), and everything seeems solved.
Interesting that it's not a huge problem for most of the people out there. Maybe people are using large enough datasets and the stochastic training process makes it less problemtic.

How about intializing it on cpu with a fixed seed, saving the params, and then porting it to GPU? Is that possible? I just have the thought of it, but cannot grab how to code it (if it works)

I had this problem today and just using the above mentioned code, I mean this one:
import numpy as np
np.random.seed(123)
import tensorflow as tf
tf.set_random_seed(123)

solved the random results issue. it seems the issue has fixed with tensorflow
I am using a GPU with CUDA 8.0.61 and CuDNN-6.0

and this link confirms it: https://keras.io/getting-started/faq/#how-can-i-obtain-reproducible-results-using-keras-during-development

I copied the code given in the link at the top of my program, but I'm still having this issue.
I'm using a Jupyter notebook on a mac book, only when I restart the whole kernel I get the same result, so the first run always corresponds to the first run, the second to the second etc.
But every time I train it I get different results.
What I am doing wrong?

Yes exactly this link.
I'm using a LSTM for sentence classification with a bag of words feature, so my input data is a vector consisting of integer values.
The only thing I do before passing it to the network is filling in zeros with sequence.pad_sequences().
(I'm not sure if this is relevant, but this was mentioned sometimes in the same context. I have a MacBook without extra GPU, so only onboard GPU without CUDA.)

Exactly the same problem as @nyxjemk . Running the model ten consecutive times and having these results:

After restarting the jupyter notebook kernel and run everything again I obtain the same results in the same order:

Any idea of what is happening?

@nyxjemk  I had exactly the same problem and managed to solve it by closing and restarting the tensorflow session every time I run the model. In your case it should look like this:
I ran the following code and had reproducible results using GPU and tensorflow backend:
print datetime.now()
for i in range(10):
    np.random.seed(0)
    tf.set_random_seed(0)
    sess = tf.Session(graph=tf.get_default_graph())
    K.set_session(sess)

    n_classes = 3
    n_epochs = 20
    batch_size = 128

    task = Input(shape = x.shape[1:])
    h = Dense(100, activation='relu', name='shared')(task)
    h1= Dense(100, activation='relu', name='single1')(h)
    output1 = Dense(n_classes, activation='softmax')(h1)

    model = Model(task, output1)
    model.compile(loss='categorical_crossentropy', optimizer='Adam')
    model.fit(x_train, y_train_onehot, batch_size = batch_size, epochs=n_epochs, verbose=0)
    print(model.evaluate(x=x_test, y=y_test_onehot, batch_size=batch_size, verbose=0))
    K.clear_session()

And obtained this output:
2017-10-23 11:27:14.494482
0.489712882132
0.489712893813
0.489712892765
0.489712854426
0.489712882132
0.489712864011
0.486303713004
0.489712903398
0.489712892765
0.489712903398

What I understood is that if you don't close your tf session (you are doing it by running in a new kernel) you keep sampling the same "seeded" distribution.

still there is a inconsistency after the third or forth digit.

Yes, I'm using it for a ranking task. The small difference unfortunately makes a difference there.
Any further news on this topic?

Just do it on CPU, no other option. speed does not make a huge difference in this case.

Mh.. I'm using CPU, still having this issue. Do I have to shut off multiprocessing to achieve the reproducibility?

Have you followed this, even in the code hierarchy.
https://keras.io/getting-started/faq/#how-can-i-obtain-reproducible-results-using-keras-during-development

Yes, I only left out the line with the multiprocessing.
# Force TensorFlow to use single thread.
# Multiple threads are a potential source of
# non-reproducible results.
# For further details, see: https://stackoverflow.com/questions/42022950/which-seeds-have-to-be-set-where-to-realize-100-reproducibility-of-training-res

session_conf = tf.ConfigProto(intra_op_parallelism_threads=1, inter_op_parallelism_threads=1)

I will try, but I think this will take just too long - not very practical. Using theano as backend results are reproducible without any limitations, so I thought there must be also a way to achieve this with tensor flow. But I will try it out.

no, you can try this with tensorflow either, not just theano. test and inform us

With theano results are reproducible for me, but for some other reasons I'd like to stick with tensorflow.
As expected it takes way longer: ~10x for the system I'm using, I will test it with 1 epoch to see if results are the same after running it twice (even this is very slow..).
I think there must be a better way. As said above, with Theano as backend I'm getting fully reproducible results, with full multiprocessing support.
I think there should be also a way with TensorFlow achieving reproducible results with multiprocessing..  from my perspective this is a really huge handy cap, -90% performance can not be the way to go.

the bad news is that theano will not continue its supports for the library. therefore we have no choice of sticking to tensorflow

yes.. therefore I was hoping there might be another way.
Adding the line:
session_conf = tf.ConfigProto(intra_op_parallelism_threads=1, inter_op_parallelism_threads=1)
does indeed solve the problem, but it is really really slow compared to normal. Too slow in my opinion to make often use of it.
Depending on the task there might be also more or less significant difference in the results on different runs.
So I hope there might be a future solution or maybe some workaround.
Is this problem TensorFlow specific, or is it just the combination of Keras and TF which leads to this issue?

hey guys,
I can reproduce my results by adding np.random.seed(1) and rn.random.seed(1) with keras + theano. the latter probably is not even necessary.
Furthermore, I can reproduce my results with pure tensorflow, by just adding np.random.seed(1) and tf.set_random_seed(1).
This was done with and without a dropoutlayer; perfectly reproducible.
I went with the keras FAQ suggestion and tried to reproduce my results with keras + tf without success.
one interesting observation:
if I use only a small amount of data or a small amount of units (LSTM with 10 units), the results are almost reproducible with keras + tf. almost means, the last 5 digits do very. but as soon as I add more data or units (say 200), the results vary a lot more. I tried with dropout layer and without. same conclusion.
also, giving the seed directly to kernel initializer and/or dropout-layer did not make any difference regarding the reproducibility
in summary:
I tried the keras FAQ suggestion without sucess for keras + tf. pure tensorflow or keras + theano are perfectly reproducible even with dropout involved.

I tried the same as you with keras+tensorflow with resnet-v2 model from keras applications with no success. Results are not reproducible.

This worked for me
# importing the libraries
import numpy as np
import tensorflow as tf
import random as rn

import os
os.environ['PYTHONHASHSEED'] = '0'

from keras import backend as k

# Running the below code every time
np.random.seed(27)
rn.seed(27)
tf.set_random_seed(27)

sess = tf.Session(graph=tf.get_default_graph())
k.set_session(sess)

## Creating model
m = Sequential()
m.add(...

## Compiling and fitting
m.compile(...
m.fit(...

@VanitarNordic Hi, the code in Keras Documents  works for me, but I still got small inconsistency after the third or forth digit as you said. When first several epoch, the inconsistency will become larger and larger, and two same code will become totally different in training values after about 10 epoch.
Do you have any idea how to solve this issue, or what raise this problem ?
Thank you for sharing your experience.

@Sucran
Upgrade to the Tensorflow 1.8 and see what happens. You can use this Anaconda package:
conda install -c hesi_m keras
which installs TF-1.8 and Keras-2.1.6 for you on the CPU. Test and let me know the results.

@VanitarNordic the gpu software environment of my lab is Ubuntu 14.04, CUDA 8 and cudnn 6.0, I install tensorflow 1.4.0 and keras-2.1.6, and I could not update to tensorflow 1.8 because of software env limitation and I could not update the software env myself since others are using it.  I am sorry for that...

I don't think you could be able to make reproducible results using Tensorflow-GPU. I have also a GPU on the system but Tensorflow uses CPU because I have installed the CPU version. You can create another anaconda environment for this purpose and test the idea

@VanitarNordic Yes, I agree with you. It is difficult to make reproducible results using TF-GPU. In my cases, although two same code got loss values with small value difference in each epoch, the data curve is almost the same but not identical (may be we can already say this is a reproducible results). However, I
still hope someone could figure out what cases this issue. I think may be it could be identical in CPU just like you said. Thank you for giving these advises.

@MartinThoma, setting the PYTHONHASHSEED environment variable to 0 ensures that python's built-in hash() function outputs the same result across multiple runs of the program (without this, the hash() function is only stable within a single run of the program). This hash() function is used everywhere, for example when you create a set or a dict.  Try running this:
>>> set("abcdefghijklmnopqrstuvwxyz")
{'p', 'f', 'g', 'i', 'n', 'o', 'k', 'c', 'h', 'b', 'v', 'a', 'd', 's', 'u', 'q', 'j', 'z', 'm', 'r', 'w', 'l', 't', 'x', 'y', 'e'}
>>> set("abcdefghijklmnopqrstuvwxyz")
{'p', 'f', 'g', 'i', 'n', 'o', 'k', 'c', 'h', 'b', 'v', 'a', 'd', 's', 'u', 'q', 'j', 'z', 'm', 'r', 'w', 'l', 't', 'x', 'y', 'e'}

If I stop the Python shell and I run the same commands, I get a different result:
>>> set("abcdefghijklmnopqrstuvwxyz")
{'c', 'y', 'q', 'g', 'a', 'u', 'd', 'k', 'w', 'j', 'm', 's', 'e', 'o', 'b', 'h', 'l', 'r', 't', 'x', 'z', 'n', 'p', 'v', 'f', 'i'}
>>> set("abcdefghijklmnopqrstuvwxyz")
{'c', 'y', 'q', 'g', 'a', 'u', 'd', 'k', 'w', 'j', 'm', 's', 'e', 'o', 'b', 'h', 'l', 'r', 't', 'x', 'z', 'n', 'p', 'v', 'f', 'i'}

However, if I start python like this:
PYTHONHASHSEED=0 python

Then I always get the same result, even across multiple restarts of the Python shell:
>>> set("abcdefghijklmnopqrstuvwxyz")
{'x', 'i', 'r', 'p', 'd', 'c', 'l', 'y', 'h', 'm', 'z', 'k', 'o', 'a', 'g', 'f', 'u', 'e', 'w', 'n', 'b', 'q', 'j', 't', 's', 'v'}

However, I noticed that setting this environment variable within the Python program did not have any effect. It only worked when setting it before the program starts. Looking at Python's source code, it seems that this environment variable is read upon startup, so I think the documentation should be fixed.
Hope this helps,
Aurélien

I think this non-deterministic behaviour is pretty much not due to Keras, but Tensorflow itself (e.g., https://stackoverflow.com/questions/45865665/getting-reproducible-results-using-tensorflow-gpu?newreg=4a6ec43834884576a175961e7f2188db).
I have tried to run the pure Tensorflow code fully_connected_feed.py from Tensorflow repo with the following settings (as recommended above by other responses):
import tensorflow as tf
import numpy as np
import random
import os
os.environ['PYTHONHASHSEED'] = '0'
np.random.seed(2019)
random.seed(2019)
tf.set_random_seed(2019)

session_conf = tf.ConfigProto(intra_op_parallelism_threads=1,
                              inter_op_parallelism_threads=1)
sess = tf.Session(graph=tf.get_default_graph(), config=session_conf)

and set shuffle=False in line 78 of fully_connected_feed.py but could not obtain reproducibility.
I could not obtain reproducibility even when runnning the code on CPU.
Note: For the Keras + Theano backend, I have also obtained a perfect reproducibility.

I've also inserted the explicit kernel (and bias) initialization:
x = layers.Dense(64, activation='relu', kernel_initializer=keras.initializers.glorot_uniform(seed=123))(x),
and this has worked.

I tried multiple version of tensorflow from 1.2.1 till 1.13.1   all of them have issues on CPU. However when I set the backend as CNTK I am able to get perfect matching results.
I have used Sequential model with only Dense layers and no dropouts.

I'm getting this issue.  I'm using this example https://www.depends-on-the-definition.com/lstm-with-char-embeddings-for-ner/ with the ner dataset. https://www.kaggle.com/abhinavwalia95/entity-annotated-corpus
Everytime I run the training, it produces a completely different metrics for fscore. precision, and recall.  THe lowest I had was 71% fscore and the highest was 83%.  I think that is a huge variation.
I tried the same on two machines one with GPU and one using only CPU, and results are the same.  unreproducable results.
I was using keras 2.2.2 + tensorflow 1.10 (unable to use latest version due to unresolved bug in keras >= 2.2.3)

any update on this please?

Still can't get reproducible results even after the usage of this method

def _seed_everything(seed=2019):
    os.environ['PYTHONHASHSEED'] = str(seed) # Os
    random.seed(seed) # Python random
    np.random.seed(seed) # Numpy random
    set_random_seed(2019) # TF random
    torch.manual_seed(seed) # Pytorch random
    torch.cuda.manual_seed(seed) # Cuda Random
    torch.backends.cudnn.deterministic = True # Cuda deterministic

Please, consider it as high priority as it becomes really difficult to do research with TF + Keras.

Hi @alberduris, please read my comment about PYTHONHASHSEED: you cannot set it within your program, you have to set it before starting Python (or Jupyter). Check out my video for more details.

Putting the following code in the beginning, I can consistently reproduce the result 100% if I only use Dense layer.
import numpy as np
import random as rn
import tensorflow as tf
import os
os.environ['PYTHONHASHSEED'] = '0'
np.random.seed(1)
rn.seed(2)
session_conf = tf.ConfigProto(intra_op_parallelism_threads=1, inter_op_parallelism_threads=1)
from tensorflow.keras import backend as K
tf.set_random_seed(3)
sess = tf.Session(graph=tf.get_default_graph(), config=session_conf)
K.set_session(sess)

Input> flatten > dense produces consistent result, but input > conv2d > flatten > dense produces different result every time I run the code.

I'd appreciate any guidance.

@jsl303 , it's no use setting PYTHONHASHSEED within the Python program, you have to set it before starting Python (it's only read by Python upon startup). This is used by Python to compute the hash (e.g., for dictionaries or sets). If you don't use any code that relies on the order of the items in sets or dictionaries, it won't make a difference, but I wouldn't count on it.
To convince yourself, try starting Python multiple times and run this command: print("".join(set("abcdefghijklmnopqrstuvwxyz"))). For example:
$ python3
...
>>> print("".join(set("abcdefghijklmnopqrstuvwxyz")))
oeqsytnmfprwbvhldxijzcugak
>>> print("".join(set("abcdefghijklmnopqrstuvwxyz")))
oeqsytnmfprwbvhldxijzcugak
>>> exit()

$ python3
...
>>> print("".join(set("abcdefghijklmnopqrstuvwxyz")))
qjufgnolbdewycpitkzvarxsmh
>>> print("".join(set("abcdefghijklmnopqrstuvwxyz")))
qjufgnolbdewycpitkzvarxsmh
>>> exit()

As you can see, although the order is consistent within one Python execution, it is not consistent across multiple runs. If you try to set PYTHONHASHSEED within your Python code, it won't be any difference, try it! But the correct approach is to set PYTHONHASHSEED before Python starts, for example on the command line:
$ PYTHONHASHSEED=0 python3
...
>>> print("".join(set("abcdefghijklmnopqrstuvwxyz")))
xirpdclyhmzkoagfuewnbqjtsv
>>> print("".join(set("abcdefghijklmnopqrstuvwxyz")))
xirpdclyhmzkoagfuewnbqjtsv
>>> exit()

$ PYTHONHASHSEED=0 python3
...
>>> print("".join(set("abcdefghijklmnopqrstuvwxyz")))
xirpdclyhmzkoagfuewnbqjtsv
>>> print("".join(set("abcdefghijklmnopqrstuvwxyz")))
xirpdclyhmzkoagfuewnbqjtsv
>>> exit()

Thanks for the explanation!
I don't use any sets or dictionaries in my code. I tried what you
suggested anyways in case. You're right. it did not make any difference.
I still get different results whenever I rerun the model with a Conv2D.

@jsl303 , glad I could help. But even if you don't use any sets or dictionaries in your code, if any library you call iterates over sets or dictionaries, the result will not be deterministic across runs. So I really recommend setting PYTHONHASHSEED=0 outside of Python. Moreover, if you are using a GPU, then it won't be deterministic because some GPU operations used by TensorFlow (through CuDNN and CUDA) are just not perfectly deterministic (such as tf.reduce_sum()). So unfortunately, if you really need things to be deterministic, you need to use the CPU. And you also need to use a single thread. Check out my video on this topic.

I am getting 100% reproducible results after following Ageorn's video. Below are the variables I set
OS: Windows
Libraries used: Keras (Tensorflow in the backend)
IDE: Anaconda
I first created a  PYTHONHASHSEED environment variable in Windows environment variables and set it to 0.
I opened jupyter notebook through Anaconda prompt and added the below code at the start of the program.
`import numpy as np
import tensorflow as tf
import random as rn
np.random.seed(10)
rn.seed(10)
config = tf.ConfigProto(intra_op_parallelism_threads=1,
inter_op_parallelism_threads=1)
with tf.Session(config=config) as sess:
pass
tf.set_random_seed(10)
`
I then used the seed while splitting dataset, initializing weights in NN's .
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30,random_state=random_seed)
model.add(Dense(45, input_dim=42, activation='tanh',kernel_initializer=keras.initializers.glorot_normal(seed=10)))
Hope this helps.

After searching for 2-3 days, a solution that I saw somewhere worked for me. Changed the optimizer to Adagrad from Adam and now I am having consistent results. Trying to find the reason for this

import random random.seed(25)
It tried only random.seed(25) and didn't use tf.set_random_seed(25) and np.random.seed(25) and it works.

Has this been fixed?  What's the recommended solution?

@pylang . Here's a summary on how to get 100% reproducibility (at the cost of performance!):

Make sure you use the same version of Python and of all libraries at each run.
Obviously, make sure the data doesn't change between runs.
Set all the random seeds: np.random.seed(42), tf.random.set_seed(42), etc., and set the PYTHONHASHSEED environment variable to 0 before starting Python (or Jupyter, or whatever Python environment you're using).
Avoid using the GPU. CUDA does have deterministic versions of most operations, but TensorFlow uses the faster but non-deterministic versions for many operations (e.g., tf.reduce_sum() is non-deterministic, and even if your code doesn't explicitly use it, many other operations use it).
More generally, avoid parallelism. Because of floating point errors, the order of execution matters. For example, 1 + 1 + 1/3 is not perfectly equal to 1/3 + 1 + 1 (check it out in a Python shell). To make TensorFlow single-threaded, you can set the TF_NUM_INTEROP_THREADS and TF_NUM_INTRAOP_THREADS environment variables to 1 before starting Python (or at least before importing TensorFlow).
Some library functions are non-deterministic. For example, os.listdir() returns files in an arbitrary order, so you should sort the list before using it.
The same code may sometimes produce different results on different platforms (e.g., 32-bit vs 64-bit platforms, or Windows vs Linux). So don't expect 100% reproducibility on different platforms (unless you work very hard to work around every single difference).

If you follow these guidelines, you should get 100% reproducible results. But as you can see, it comes at a high cost (especially dropping the GPU!), so you may ask yourself: is it worth the effort? Perhaps instead of perfect reproducibility, you could run the code multiple times and ensure that it produces approximately the same output on average, and the variance is low.
Hope this helps.

@abali96
I found your comment on here.
(https://keras.io/getting_started/faq/#how-can-i-obtain-reproducible-results-using-keras-during-development)
The way how I get reproducible result is to put tf.random.set_seed() in your function.
for example.
'''
def model():
tf.random.set_seed()
model
return **
'''
Hope others solve this problem as well!

你好，已收到你的邮件。                                                        --魏浩

For everyone who had the same issue as described here but still came across this issue, please have a look at these links:

Tensorflow has an experimental option to run the model training on GPU in a deterministic way.
https://www.tensorflow.org/api_docs/python/tf/config/experimental/enable_op_determinism
I checked it out and it worked for me very well (using keras lstm, dropout, dense layer).

Here is a repository which formerly provided patches for tensorflow determinism, and now they track the status of each functionality, whether it is available as deterministic method or why there are still issues with it.
https://github.com/NVIDIA/framework-determinism/blob/master/doc/tensorflow_status.md

FYI: Theano backend can't be used anymore since keras 2.4.0


feat: generate API Documentation from API code

Demo:

Error handling for 4k token limit to show friendly message:

seems the CI codecov/path is lower than target, better to add ut

seems the CI codecov/path is lower than target, better to add ut

added


Rename writable function

Renames the writable() function to persisted().
This is to avoid confusion with Svelte's built-in writable.
The old way is still supported, but it will raise a deprecation warning.

Codecov Report

Merging #133 (87d7b10) into master (1519a2d) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #133   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            1         1
  Lines           32        35    +3
  Branches        11        11
=========================================
+ Hits            32        35    +3

Impacted Files
Coverage Δ

index.ts
100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Tests for vite-plugin-shopify

This PR adds tests for the two main functionalities of vite-plugin-shopify

[x] Configuring Vite

[x] Build Options
[x] Server Options
[x] Shared Options

[x] Generating HTML tags for loading entrypoints

[x] Asset urls served locally for development
[x] Asset urls served from Shopify's CDN for production

It also makes the plugin work properly on Windows 🚀

Nice work! 👏


Debug the mobile phone rendering bug

Suggested by @shgnplaatjies to use Google maps API key to fix the issue of rendering google maps on mobile phone. Probably permissions issues.
Check https://developers.google.com/maps/documentation/embed/get-api-key


About the computation of Advantage and State Value in PPO

In your implementation of Critic, you feed the network of the observation and action and output 1-dim value. Can I make the inference that It is Q(s,a) ?
But the advantage you given is
values = self.critic_target(states_var, actions_var).detach()  advantages = rewards_var - values
It is the estimation of q_t minus Q(s_t,a)
I think it should be Advantage = q_t - V(s_t)

Which code are you talking about? I didn't use action as input to my value network.

Sorry for mistaken, close it now


Some fixes on Welcome and dask notebook

Improves explanations and layout mainly.
Corrects some sentences.

ping @rabernat or @jhamman for a review.

Thanks @guillaumeeb!


Add calculate commands and log more

I've added a few cool commands to read from the database

read coverage for a list of genes
read coverage for a region of exons

I've added more logging and general clean up

Rebase is finished - should be ready to merge now :smiley:


Add support for Kafka

It would be nice to have support for Kafka components: Reader, Writer, etc.

This was in my todo list since I added support for JMS, but I never had time to work on it.
Kafka is awesome and it would be great to have an extension for it.
If you are comfortable with Kafka APIs, you are welcome to submit a pull request. There are only a couple of interfaces to implement. This would be a fantastic contribution!
Let me plan that for next release.

Sure! I have some experience with Kafka and I could help in my free time (that is not that much at the moment :( ). Btw, what is the difference in project organization between the module "easybatch-extensions" and the other root level ones, such as "easybatch-jms"? Where should I place the kafka one?

Oh great news! you are welcome. Do it on your own pace, no worries.
root level modules are for core java (EE) APIs (jdbc, jms, jpa, etc ).
Integrations with third party tools should go under easybatch-extensions.
So for kafka, it should be in the extensions directory (BTW, I add a 'extension' label on the issue if it is a new extension that is requested).

@raulgomis Still willing to contribute a Kafka record reader/writer to Easy Batch?
FTR, I contributed to adding kafka support in Spring Batch and could do it here too. but since you offered to help, I want to give the credit to you, unless you tell me otherwise.
Looking forward to your reply.

Hey @benas !
Thanks for asking! I have an initial version in my fork, I'll finish it during next week and create a PR so that we can discuss it.
Regards,
Raul

Hi @raulgomis ,
If you are still interested in contributing Kafka record reader/writer, please do it in a repo on your side and I will be more than happy to add a reference to it in the home page.
Thank you!
Best regards,
Mahmoud


Plugins and Workspaces in public directory

Public front end resources should be taken out of the XYZ repository and made available in a different public repository.
It shouldn't require a PR in this repository to change a plugin or workspace.
Development workspaces and all plugins should not be part of all deployments.

Will any plugins then remain as core?

No.

Versioning is going to be the big problem here though.
Thoughts of tagging commits on the branch for plugins is good.
Or multiple branches.

An issue maybe, but not necessarily a problem. Let's say a PR breaks a plugin, or a change to the workspace causes an issue. Not great if they are both part of the same repository. Not a problem if the plugin is only loaded if needed.
At current there are 23 plugins in the public folder. I know that some of them do not work. Who checks every plugin on every PR? Will there be 30+ plugins in the future? 50? 100+?
Versioning is not a problem if there is nothing to version in the public directory. At current the plugin directory is unmaintainable hence this RFC.

https://github.com/GEOLYTIX/xyz/pull/583


update patches to match upstream repo new structure

Updating patches to comply with new upstream repo structure. Upstream PR https://github.com/knative/func/pull/1554

/cc @zroubalik @lance @matejvasek

/lgtm
/approve


Issue listing need to be multi-lined.

Single is definitely not enough.

This takes time. Do it later.
Use tooltip at now.

Tooltip how-to: http://stackoverflow.com/questions/15023589/different-tooltip-for-each-image-in-nstableview

Tooltip doesn't work. I don't know why...
Do it later. It's not important now.

Closes because I completely re-wrote whole code, and this issue is not relevant anymore.


re-deploying efs-provisioner causes EFS data to be deleted.  Expected?

I have a Terraform script that installs efs-provisioner + grafana etc.
I noticed that after I destroy + re-deploy the provisioner, the data in EFS is gone.  Is this expected?

no, please share more information about what destroy + re-deploy means

I have a terraform provisioning script that creates an EKS cluster, and installs external-dns and efs-provisioner, and installs grafana, which is configured to use the EFS.  This all seems to work well, and if I delete the grafana pod, the newly created pod still sees the files in EFS.  However if I destroy the cluster and re-provision it, all the data in EFS is gone, and grafana ends up with a new/empty EFS folder.

when you destroy the cluster, every object including every PVC is getting deleted right? The reclaimPolicy defaults to delete so the provisioner will clean up every PV. If grafana is consuming the EFS folder via PVC, I'm not sure how to preserve it across clusters.

I created the StorageClass with a reclaimPolicy: Retain.  I thought that would prevent it from cleaning up existing data?

yes, you can confirm that's the case by checking that the PVs have reclaimPolicy: Retain too

The PV does have reclaimPolicy set to Retain:
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                     STORAGECLASS   REASON   AGE
pvc-d140d985-de27-11e8-a52a-0a49aed46e1a   1Mi        RWX            Retain           Bound    default/efs                               aws-efs                 3d

Yet when I destroy the cluster, the EFS data gets wiped...  Any ideas why that is happening?

It's possible if the provisioner is too old it won't respect the reclaimpolicy on the PV. what version is it? Can you try deleting a single PVC and see what happens?

I'm deploying the latest provisioner:
          image: quay.io/external_storage/efs-provisioner:latest

I did verify that deleting the PVC causes the efs data to be erased.

My bad, version doesn't matter, I was thinking about reclaimpolicy on the SC...respect for reclaimpolicy on PVs has always existed.
Please check/provide the logs of the provisioner when you delete a single PVC, it must be saying things like "volume deleted" etc. Does the PV get deleted too when you delete a PVC?

The PV does not get deleted when the PVC is deleted.  It is just marked as "Released":
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS     CLAIM                                     STORAGECLASS   REASON   AGE
pvc-5283bd96-e12b-11e8-a52a-0a49aed46e1a   1Mi        RWX            Retain           Released   default/efs-2                             aws-efs                 25m
pvc-652634ce-e12e-11e8-a52a-0a49aed46e1a   1Mi        RWX            Retain           Released   default/efs-2                             aws-efs                 3m
pvc-d140d985-de27-11e8-a52a-0a49aed46e1a   1Mi        RWX            Retain           Bound      default/efs                               aws-efs                 3d
pvc-fcd6e3b7-e12a-11e8-acbf-0ed082658fa6   1Mi        RWX            Retain           Released   default/efs-2                             aws-efs                 27m
pvc-fdb26fb8-e12d-11e8-acbf-0ed082658fa6   1Mi        RWX            Retain           Released   default/efs-2                             aws-efs                 5m

The efs-provisioner log doesn't show anything at all when deleting the PVC.  When the pod/pvc are re-created, I see the typical messages:
I1105 19:13:55.094607       1 controller.go:987] provision "default/efs-2" class "aws-efs": started
I1105 19:13:55.099799       1 event.go:221] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"efs-2", UID:"f0471f52-e12e-11e8-acbf-0ed082658fa6", APIVersion:"v1", ResourceVersion:"702326", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/efs-2"
I1105 19:13:55.118111       1 controller.go:1087] provision "default/efs-2" class "aws-efs": volume "pvc-f0471f52-e12e-11e8-acbf-0ed082658fa6" provisioned
I1105 19:13:55.118133       1 controller.go:1101] provision "default/efs-2" class "aws-efs": trying to save persistentvvolume "pvc-f0471f52-e12e-11e8-acbf-0ed082658fa6"
I1105 19:13:55.124014       1 controller.go:1108] provision "default/efs-2" class "aws-efs": persistentvolume "pvc-f0471f52-e12e-11e8-acbf-0ed082658fa6" saved
I1105 19:13:55.124045       1 controller.go:1149] provision "default/efs-2" class "aws-efs": succeeded
I1105 19:13:55.124119       1 event.go:221] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"efs-2", UID:"f0471f52-e12e-11e8-acbf-0ed082658fa6", APIVersion:"v1", ResourceVersion:"702326", FieldPath:""}): type: 'Normal' reason: 'ProvisioningSucceeded' Successfully provisioned volume pvc-f0471f52-e12e-11e8-acbf-0ed082658fa6

I think I understand what you're saying...  couple of follow-up questions:

would what you're saying also explain why manually deleting just the PVC causes the next PVC to not show any data?  (not deleting the provisioner or the cluster, just the PVC)
is your recommendation then to just not use the provisioner?

yes. For example, say the first pvc-1 points to pv-1 which has path /pv-1. When you create a new pvc-2 it points to pv-2 which has path /pv-2. Ideally if you want to reuse the data in pv-1 you would not delete pvc-1 at all, and instead remount pvc-1 in the new pod. Or you can make a copy of pv-1 and bind pvc-2 to it then mount pvc-2 in the new pod.
yes, in this case. The provisioner is fine for when we need data to survive pod restarts or to consume the same data in different pods. But if we need to also survive cluster recreations then it would be better to store data in a known place like "/grafana."

makes sense.  thanks a lot for your help and responsiveness!  👍

Thanks, cleared up my problem as well. Seems like the provisioner could be updated to allow pathnames to be defined, which would eliminate this issue.