[BUG] Clean install doesn't compile: export 'TranslationContext' (imported as 'lt') was not found in '@refinedev/core' in mui.js

Describe the bug
I just set up a refine project and tried to run it without changing anything but it does not compile.
It rather shows this error:
ERROR in ./node_modules/.pnpm/@refinedev+inferencer@3.5.4_@ant-design+icons@5.0.1_@emotion+react@11.8.2_@emotion+styled<EMAIL_ADDRESS>1112:15-17
export 'TranslationContext' (imported as 'lt') was not found in '@refinedev/core'

Steps To Reproduce

Open terminal
Run create refine-app with following command:
npm create refine-app@latest client
Select following options:

✔ Choose a project template · refine-react
✔ What would you like to name your project?: · client
✔ Choose your backend service to connect: · data-provider-custom-json-rest
✔ Do you want to use a UI Framework?: · mui
✔ Do you want to add example pages?: · inferencer
✔ Do you need any Authentication logic?: · auth-provider-google
✔ Do you need i18n (Internationalization) support?: · no
✔ Choose a package manager: · pnpm
✔ Would you mind sending us your choices so that we can improve superplate? · yes

complete the installation
move to project folder and launch it like this cd client && pnpm dev

Expected behavior
Launching the clean new project should compile and run without errors
Screenshot
Full output below
pnpm dev

><EMAIL_ADDRESS>dev /home/kevin/Projects/refine_dashboard/client
> refine start

(node:11956) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:11956) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...

Failed to compile.

Attempted import error: 'TranslationContext' is not exported from '@refinedev/core' (imported as 'lt').
assets by path static/js/*.js 11.6 MiB
  asset static/js/bundle.js 11.6 MiB [emitted] (name: main) 1 related asset
  asset static/js/node_modules_pnpm_web-vitals_1_1_1_node_modules_web-vitals_dist_web-vitals_js.chunk.js 6.78 KiB [emitted] 1 related asset
asset index.html 1.99 KiB [emitted]
asset asset-manifest.json 598 bytes [emitted]
orphan modules 7.49 MiB [orphan] 11261 modules
runtime modules 31.7 KiB 16 modules
cacheable modules 8.88 MiB
  modules by path ./node_modules/.pnpm/ 8.83 MiB 1402 modules
  modules by path ./src/ 46.5 KiB
    modules by path ./src/pages/ 18.5 KiB 11 modules
    modules by path ./src/*.tsx 17.2 KiB
      ./src/index.tsx 1.89 KiB [built] [code generated]
      ./src/App.tsx 15.3 KiB [built] [code generated]
    ./src/reportWebVitals.ts 1.43 KiB [built] [code generated]
    ./src/contexts/color-mode/index.tsx 2.85 KiB [built] [code generated]
    ./src/components/header/index.tsx 5.14 KiB [built] [code generated]
    ./src/utils/parse-jwt.ts 1.36 KiB [built] [code generated]
  ./util.inspect (ignored) 15 bytes [built] [code generated]

WARNING in [eslint]
src/App.tsx
  Line 4:3:   'WelcomePage' is defined but never used  @typescript-eslint/no-unused-vars
  Line 11:3:  'AuthPage' is defined but never used     @typescript-eslint/no-unused-vars

ERROR in ./node_modules/.pnpm/@refinedev+inferencer@3.5.4_@ant-design+icons@5.0.1_@emotion+react@11.8.2_@emotion+styled<EMAIL_ADDRESS>1112:15-17
export 'TranslationContext' (imported as 'lt') was not found in '@refinedev/core' (possible exports: AuthPage, Authenticated, CanAccess, ErrorComponent, GitHubBanner, LayoutWrapper, LoginPage, ReadyPage, Refine, ResourceContext, RouteChangeHandler, UndoableQueue, WelcomePage, createTreeView, file2Base64, getDefaultFilter, getDefaultSortOrder, getNextPageParam, getPreviousPageParam, handleUseParams, importCSVMapper, legacyResourceTransform, matchResourceFromRoute, parseTableParams, parseTableParamsFromQuery, pickNotDeprecated, routeGenerator, setInitialFilters, setInitialSorters, stringifyTableParams, unionFilters, unionSorters, useActiveAuthProvider, useApiUrl, useAuthenticated, useBack, useBreadcrumb, useCan, useCanWithoutCache, useCancelNotification, useCheckError, useCreate, useCreateMany, useCustom, useCustomMutation, useDataProvider, useDelete, useDeleteMany, useExport, useForgotPassword, useForm, useGetIdentity, useGetLocale, useGetToPath, useGo, useHandleNotification, useImport, useInfiniteList, useInvalidate, useIsAuthenticated, useIsExistAuthentication, useLink, useList, useLiveMode, useLog, useLogList, useLogin, useLogout, useMany, useMenu, useModal, useMutationMode, useNavigation, useNotification, useOnError, useOne, useParse, useParsed, usePermissions, usePublish, useRedirectionAfterSubmission, useRefineContext, useRegister, useResource, useResourceSubscription, useResourceWithRoute, useRouterContext, useRouterType, useSelect, useSetLocale, useShow, useSubscription, useSyncWithLocation, useTable, useTitle, useToPath, useTranslate, useUpdate, useUpdateMany, useUpdatePassword, useWarnAboutChange, userFriendlyResourceName)
 @ ./src/pages/blog-posts/show.tsx 4:0-62 7:30-47
 @ ./src/pages/blog-posts/index.ts 6:0-38 6:0-38
 @ ./src/App.tsx 13:0-92 202:50-62 213:50-64 224:50-62 235:50-62
 @ ./src/index.tsx 7:0-24 12:33-36

webpack 5.84.1 compiled with 1 error and 1 warning in 39507 ms
No issues found.
Compiling...
Failed to compile.

Attempted import error: 'TranslationContext' is not exported from '@refinedev/core' (imported as 'lt').
assets by status 6.78 KiB [cached] 1 asset
assets by chunk 11.6 MiB (name: main)
  asset static/js/bundle.js 11.6 MiB [emitted] (name: main) 1 related asset
  asset main.db03048376b87da596b7.hot-update.js 357 bytes [emitted] [immutable] [hmr] (name: main) 1 related asset
assets by path *.json 751 bytes
  asset asset-manifest.json 723 bytes [emitted]
  asset main.db03048376b87da596b7.hot-update.json 28 bytes [emitted] [immutable] [hmr]
asset index.html 1.99 KiB [emitted]
Entrypoint main 11.6 MiB (10.2 MiB) = static/js/bundle.js 11.6 MiB main.db03048376b87da596b7.hot-update.js 357 bytes 2 auxiliary assets
orphan modules 7.49 MiB [orphan] 11258 modules
cached modules 852 KiB [cached] 233 modules
runtime modules 31.7 KiB 16 modules
cacheable modules 8.05 MiB
  modules by path ./node_modules/.pnpm/ 8 MiB 1173 modules
  modules by path ./src/ 46.5 KiB
    modules by path ./src/pages/ 18.5 KiB 11 modules
    modules by path ./src/*.tsx 17.2 KiB
      ./src/index.tsx 1.89 KiB [built]
      ./src/App.tsx 15.3 KiB [built]
    ./src/reportWebVitals.ts 1.43 KiB [built]
    ./src/contexts/color-mode/index.tsx 2.85 KiB [built]
    ./src/components/header/index.tsx 5.14 KiB [built]
    ./src/utils/parse-jwt.ts 1.36 KiB [built]

WARNING in [eslint]
src/App.tsx
  Line 4:3:   'WelcomePage' is defined but never used  @typescript-eslint/no-unused-vars
  Line 11:3:  'AuthPage' is defined but never used     @typescript-eslint/no-unused-vars

ERROR in ./node_modules/.pnpm/@refinedev+inferencer@3.5.4_@ant-design+icons@5.0.1_@emotion+react@11.8.2_@emotion+styled<EMAIL_ADDRESS>1112:15-17
export 'TranslationContext' (imported as 'lt') was not found in '@refinedev/core' (possible exports: AuthPage, Authenticated, CanAccess, ErrorComponent, GitHubBanner, LayoutWrapper, LoginPage, ReadyPage, Refine, ResourceContext, RouteChangeHandler, UndoableQueue, WelcomePage, createTreeView, file2Base64, getDefaultFilter, getDefaultSortOrder, getNextPageParam, getPreviousPageParam, handleUseParams, importCSVMapper, legacyResourceTransform, matchResourceFromRoute, parseTableParams, parseTableParamsFromQuery, pickNotDeprecated, routeGenerator, setInitialFilters, setInitialSorters, stringifyTableParams, unionFilters, unionSorters, useActiveAuthProvider, useApiUrl, useAuthenticated, useBack, useBreadcrumb, useCan, useCanWithoutCache, useCancelNotification, useCheckError, useCreate, useCreateMany, useCustom, useCustomMutation, useDataProvider, useDelete, useDeleteMany, useExport, useForgotPassword, useForm, useGetIdentity, useGetLocale, useGetToPath, useGo, useHandleNotification, useImport, useInfiniteList, useInvalidate, useIsAuthenticated, useIsExistAuthentication, useLink, useList, useLiveMode, useLog, useLogList, useLogin, useLogout, useMany, useMenu, useModal, useMutationMode, useNavigation, useNotification, useOnError, useOne, useParse, useParsed, usePermissions, usePublish, useRedirectionAfterSubmission, useRefineContext, useRegister, useResource, useResourceSubscription, useResourceWithRoute, useRouterContext, useRouterType, useSelect, useSetLocale, useShow, useSubscription, useSyncWithLocation, useTable, useTitle, useToPath, useTranslate, useUpdate, useUpdateMany, useUpdatePassword, useWarnAboutChange, userFriendlyResourceName)
 @ ./src/pages/categories/list.tsx 4:0-62 7:30-47
 @ ./src/pages/categories/index.ts 3:0-38 3:0-38
 @ ./src/App.tsx 14:0-92 253:50-62 264:50-64 275:50-62 286:50-62
 @ ./src/index.tsx 7:0-24 12:33-36

webpack 5.84.1 compiled with 1 error and 1 warning in 32265 ms
No issues found.

Desktop

OS: Ubuntu 22.04
Browser: Google Chrome

Mobile
No response
Additional Context
No response

Thanks for the report @kevnoutsawo, we'll check it and get back to you.

Hey @kevnoutsawo, for now, you can use npm as a workaround, issue is with pnpm installs, we are on it.

Hey @kevnoutsawo, for now, you can use npm as a workaround, issue is with pnpm installs, we are on it.

Thanks for your reply. I posted another issue here 2 days ago regarding installation with npm and the workaround was to use pnpm. As of now, installation with npm systematically fails for me still with the SAOerror issue.
I tried using yarn it ran the installation successfully. I never use it but I will accommodate. I am just discovering refine and it looks promising. I hope the developer experience becomes smoother with time.

Hey @kevnoutsawo
We are sorry for this issue 😢 We did not encounter any problems in its working with npm. We will solve the pnpm issue shortly.

Hey @kevnoutsawo, this looks like an issue with the pnpm store. Running pnpm store prune to purge the cached modules can solve the issue. This is probably happening due to the peer dependencies letting pnpm use an older version of the @refinedev/core rather than the latest. Or if you want, after the creation of the project, you can do pnpm install @refinedev/core@latest to try installing the latest version of refine's core.
We'll work on peer dependencies to make sure we're keeping them in sync with the @refinedev/core's version. Sorry for the issue.

Hey @kevnoutsawo, this looks like an issue with the pnpm store. Running pnpm store prune to purge the cached modules can solve the issue. This is probably happening due to the peer dependencies letting pnpm use an older version of the @refinedev/core rather than the latest. Or if you want, after the creation of the project, you can do pnpm install @refinedev/core@latest to try installing the latest version of refine's core.
We'll work on peer dependencies to make sure we're keeping them in sync with the @refinedev/core's version. Sorry for the issue.

Hi @aliemir , doing pnpm install @refinedev/core@latest fixed it on pnpm, it now works after that.
As for the SAOerror, it seems to be located in superplate as there are many issues in that repo too about that error.
Maybe those facing that can stay away from npm for now but when you are used to it, it is harder to learn a new package manager and learn refine at the same time. I hope a proper solution is found soon.
Thanks a lot for your support.

Closing this issue for now. We'll update our dependency management and address this issue in the upcoming changes. 🙏

Hello @kevnoutsawo, Thanks for the issue 🙌
We have changed our release process. Now, when we release a package, we also update the peer dependencies for the packages that require it. This should resolve the issue.
I'm closing this issue. If you encounter any problems, please don't hesitate to reopen it. 👍


Easy way to mod gui

Move most of code for res://gui scripts to new classes in res://addons/rakugo/gui.
And made scripts in res://gui to just simple extsions of classes form res://addons/rakugo/gui.
Also made try to made some simple way to replace elements of gui with out copy all gui and changing it or overwrite it.
Maybe I will use godot's placeholder mechanism:
https://docs.godotengine.org/en/3.2/classes/class_instanceplaceholder.html

Make more modular gui scripts,
Just make script that loads all scenes for the same folder to main scene of this folder.
And this script treats form scenes form res://game/gui as superior.

After some thing I see there is non need for that.


Fix usage of "as" with "extracting" in tests

Just found misuse while hacking around.

Well spotted, I will add that misuse in the doc.


PTY for process 'process0' is not yet supported on Windows

Hello there!
I am aware that Windows support isn't complete yet, so I wanted to ask what the status was on this?
Here is the process-compose file that triggered the error:
version: "0.5"
processes:
  db:
    description: SurrealDB Database
    command: surreal start
    readiness_probe:
      exec:
        command: surreal is-ready
      initial_delay_seconds: 5
      period_seconds: 10
      timeout_seconds: 5
      success_threshold: 1
      failure_threshold: 3
    liveness_probe:
      http_get:
        host: <IP_ADDRESS>
        scheme: http_getpath: /
        port: 8000
      initial_delay_seconds: 5
      period_seconds: 2
      timeout_seconds: 5
      success_threshold: 1
      failure_threshold: 3
    vars:
      # Settings
      - "SURREAL_NO_BANNER=true"
      - "SURREAL_STRICT=true"
      - "SURREAL_PATH=file:./runtime/db"
      - "SURREAL_CLIENT_IP=socket"
      - "SURREAL_CAPS_DENY_GUESTS=false"
      # Authentication
      - "SURREAL_AUTH=true"
      - "SURREAL_USER=db"
      - "SURREAL_PASS=db"

  app:
    command: ./dsb-tool.exe
    depends_on:
      db:
        condition: process_healthy

  app-dev:
    command: air
    depends_on:
      db:
        condition: process_healthy

  vite:
    command: vite

It's nothing too special, but due to how the restrictiions on our work laptops are, Docker and Podman have issues - so I sought to just deploy the environment locally...ish. :)
thank you and kind regards!

Hi @senpro-ingwersenk,
I plan to work on this, however, due to a very limited access to a Windows environment, it takes time even to start.
In a Linux terminal, the fastest way to check if the code works as expected is a simple command: ls -lFa --color=tty. Is there something similar in Windows?
Which tty command are you using? I see 4 tools, which one requires tty?


Great tool <3

Hey @HHK1, great tool you have here !
This is a feature that was requested in our media picker and some users pointed us towards you library.
Just wanted to let you know that we are looking at integrating PryntTrimmerView as a dependency as part of our Media Picker tool YPImagePicker.
Begining implementation can be found: here
Let me know how you'd feel about that :)
Cheers!

Hey @s4cha !
The code is published with a MIT license, so there is no issue at all with that!
If you feel like referencing this library on your Readme that's up to you, but that's entirely up to you.
I see that you are using Carthage for dependencies, I've never used it in projects, but the setup didn't seem too complex so I've added a prebuilt framework to the latest release: https://github.com/prynt/PryntTrimmerView/releases
Tell me if that works for you, I'll mark the library as Carthage compatible in the Readme then.

@HHK1 That's some awesome news!
Of course, once the next version will be live, we'll reference your repo on our Readme :)
Concerning Carthage, you can also upload the .framework inside the release as seen here:
https://github.com/Yummypets/YPImagePicker/releases/tag/2.8.1
I was actually about to submit a PR for Carthage support so thanks a ton for thinking a bout us !
Carthage pul still l doesn't seem to work though.
Here is the log for reference:
MacBookPro-Sacha:test sacha$ carthage update
*** Fetching PryntTrimmerView
*** Checking out PryntTrimmerView at "2.0.1"
*** xcodebuild output can be found in /var/folders/6t/3blf7h3950gfx14v61r581wm0000gq/T/carthage-xcodebuild.i5fo7q.log
*** Skipped building PryntTrimmerView due to the error:
Dependency "PryntTrimmerView" has no shared framework schemes

If you believe this to be an error, please file an issue with the maintainers at https://github.com/prynt/PryntTrimmerView/issues/new
MacBookPro-Sacha:test sacha$

What I did locally for reference was go intoEdit Scheme then manage scheme then check
PryntTrimmerView and also cheek it as shared.
This makes it "visible" by Carthage.
Cheers,

It looks like xcshareddata in the gitignore prevents us from pushing it though :)

Hmm, here is what I did:

I did check that the scheme for the framework was shared, here is what I have:

I downloaded carthage and used carthage build --no-skip-current which gave me the following:

*** xcodebuild output can be found in /var/folders/g3/_t28w37x489d84kjk6c_fkm00000gn/T/carthage-xcodebuild.7Ua6eq.log
*** Building scheme "PryntTrimmerView" in PryntTrimmerView.xcworkspace
*** Building scheme "PryntTrimmerView" in PryntTrimmerView.xcworkspace

I then ran carthage archive PryntTrimmerView to archive the framework.

Got this from the terminal:
*** Found Carthage/Build/iOS/PryntTrimmerView.framework
*** Found Carthage/Build/iOS/PryntTrimmerView.framework.dSYM
*** Found Carthage/Build/iOS/1AB5664E-2FF1-3A15-93E8-009B0CC46950.bcsymbolmap
*** Found Carthage/Build/iOS/D89DDCCF-7515-39FC-A978-1C09A1E7BE26.bcsymbolmap
*** Found Carthage/Build/iOS/38BB924E-4197-38C0-9E2B-081283FE3D51.bcsymbolmap
*** Found Carthage/Build/iOS/45449960-B848-3087-88AB-138355679028.bcsymbolmap
*** Created PryntTrimmerView.framework.zip

I made a commit, tagged and pushed to this repo under release 2.0.1

I'm going to try installing the dependency in a dummy projet, see what happens. In the meantime:

If you notice anything blatantly wrong in the above, just tell me and I'll fix it.
If you have a working branch that is carthage compatible, you can open a pull request

@HHK1 I think the missing thing is just manually uploading the '.framework' in the release on GitHub.
Question, when you shared the PryntTrimmerView, did it show in git? If you want Carthage support to work without having to manually upload a .framework, we'll need to have the shared scheme setting pushed to GitHub.
Hope that helps,

I've uploaded the .framework.zip in the release, does it work for you ?
I'm looking at pushing the schemes changes to git, it seems that indeed they are not taken into account

Awesome! carthage update works because it's smart enough to take the pre-built framework when available. For the "classic" integration, you can run carthage update --no-use-binaries. This one will work when we sort the share scheme thing out. No rush I can help you with that later if you want :)

@s4cha I think it's because the scheme is part of the Pods project. I'm recreating a target that should be visible to Carthage

@s4cha I've updated the project to include a shared scheme that is not in the Pods .xcodeproj
Updating the dependencies on a dummy project using the --no-use-binaries flag is working on my end. Tell me if it's good for you, and I'll add the carthage compatibility on the readme, and I'll close this issue.

@HHK1 it now works perfectly 👌


Flipped flow maps in the flow loss

Hi Gengshan,
Thanks for the great work.
I noticed that you flip the flows before saving in autogen.py
https://github.com/google/lasr/blob/29d8759354f853119276f41504d6b527fd5484e5/preprocess/auto_gen.py#L173-L178
Is there a good reason to do this?
An unintended consequence is that it leads to flipped flows being loaded at training time and the flow loss ends up being wrong.
Here's an example of flow error being logged while running lasr on Camel example. As you can see, the ground truth flow here is flipped

Yes, there's a corresponding flip operation in readPFM as well,
https://github.com/google/lasr/blob/29d8759354f853119276f41504d6b527fd5484e5/third_party/ext_utils/util_flow.py#L79
So maybe the initial flipping is not needed?

Yeah, I believe the flip operation is not necessary within the the pfm functions.


NPE in dev.csaba.arphysics.MainActivity.onTransformChanged

Reported by the Play Store. Interesting that the app was not installed from the Play Store but from some other channels, it came from a Samsung Galaxy A70 and ZTE Z717VL (Android 9 - API 28 and Android 10 API 29) devices. https://play.google.com/console/u/0/developers/7696534728259995393/app/4974857956571804228/vitals/crashes/d415f426/details?days=30
Call stack:
java.lang.NullPointerException:
  at dev.csaba.arphysics.MainActivity.onTransformChanged (MainActivity.java:307)
  at com.google.ar.sceneform.Node.dispatchTransformChanged (Node.java:1431)
  at com.google.ar.sceneform.Node.markTransformChangedRecursively (Node.java:524)
  at com.google.ar.sceneform.Node.markTransformChangedRecursively (Node.java:533)
  at com.google.ar.sceneform.Node.setParent (Node.java:284)
  at dev.csaba.arphysics.MainActivity.lambda$clearScene$4 (MainActivity.java:437)
  at dev.csaba.arphysics.-$$Lambda$MainActivity$wFvLAfQoVpA5JteXk3ovHe6pqOg.accept (Unknown Source:2)
  at com.google.ar.sceneform.Node.callOnHierarchy (Node.java:1161)
  at com.google.ar.sceneform.NodeParent.callOnHierarchy (NodeParent.java:96)
  at dev.csaba.arphysics.MainActivity.clearScene (MainActivity.java:433)
  at dev.csaba.arphysics.MainActivity.lambda$initializeGallery$5$MainActivity (MainActivity.java:463)
  at dev.csaba.arphysics.-$$Lambda$MainActivity$OjuNocQDMm-AtmJE8pLxzIpG_IM.onClick (Unknown Source:2)
  at android.view.View.performClick (View.java:7870)
  at android.view.View.performClickInternal (View.java:7839)
  at android.view.View.access$3600 (View.java:886)
  at android.view.View$PerformClick.run (View.java:29363)
  at android.os.Handler.handleCallback (Handler.java:883)
  at android.os.Handler.dispatchMessage (Handler.java:100)
  at android.os.Looper.loop (Looper.java:237)
  at android.app.ActivityThread.main (ActivityThread.java:7814)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1068)

Upon investigation the faulty code was the jBulletController.updateCylinderLocation inside the onTransformChanged. The onTransformChanged is the callback for Sceneform's TransformableNode (
The safety check checks on cylinderNode != null but it seems that during Scene clear operation we must manually null the cylinderNode which we keep a pointer to ourselves. This tricked the safety checks. The Scene was mostly clear, but an unwanted cylinder node still kept alive (possibly due to our action of holding a strong pointer at it). The updates kept coming but we destroyed the Physics engine. I'm adding more safety checks and making sure taking care of the cylinderNode pointer. As an extra I call clearSceve from the onDestroy as well.


Change base image to openjdk:13-ea-oraclelinux7

The openjdk:11-jdk-slim image has some vulnerabilities and it's recommended to switch to openjdk:13-ea-oraclelinux7 in order to mitigate them.
I'm not sure if we oraclelinux image needs a license or not.

I'm fine moving to openjdk:11-jdk-oraclelinux7 since Java 11 is tested, however Java 13 is still early access and untested for our code.

Changed base image to openjdk:11-jdk-oraclelinux7


Revert "Add parameter trackBy on form type select."

Reverts Textalk/angular-schema-form#418
It caused a regression bug: https://github.com/Textalk/angular-schema-form/issues/473
Some of the tests also lacked a done() callback so they just appeared to succeed.

It was also the culprit behind https://github.com/Textalk/angular-schema-form/issues/458


Option to toggle/revert to 0.14 behaviour of Fallible SystemParams

What problem does this solve or what need does it fill?
In bigger Projects there is already a lot going on in the Terminal during runtime. If now forgetting to add some Resource etc. generates only logging (or nothing at all), that something won't happen, but the app otherwise launching and working often entails debugging that wouldn't be necessary in the first place, if it would just crash the program with the log message as the panic message, as it was historically.
If a Resource etc. is missing, it's supposed to interrupt my workflow, which is why i consider the old behavior a safeguard.
What solution would you like?
Some Sort of functionality to toggle the behavior globally. It could be one of these things:

A Flag to set it to panic, log or none globally by default, with the option to override it, as seen in 0.15 (could be nice, since it could be disabled for release builds. This could be problematic with other parts of bevy potentially).
An Option in DefaultPlugins (That defines the default behavior for all Systems. Same Problem as first Option)
An Option to set the Default behavior on a Plugin level (All systems added via this plugin have the following behavior of none, logging once, loggin always, panic)
Catching nonworking SystemParams (like a missing Resource) in a System without defined behaviour (not using .never_param_warn(), ...) during compile time and throwing a hard error (i'm not sure how possible that would be, if at all)

The Last option would be personally my favourite.
What alternative(s) have you considered?
Not upgrading to 0.15 just yet, until some interface is available to toggle to this or a similarly obvious behavior.
Additional context
i'm talking specifically about the feature mentioned in https://bevyengine.org/news/bevy-0-15/#fallible-system-parameters

I think panics by default should be re-introduced
catching it at compile time is impossible as some of the system parameters can be made valid/invalid at runtime

catching at compile time not being possible makes sense, i think it was a suggestion from the bevy discord.
Restoring the previous behaviour would be great yeah. I would say the panicking along side the additional behaviour of logging/none is probably a good compromise.
I guess one of the chores might be to go through the codebase and make sure, that the Systems, that shouldn't panic on missing/unloaded SystemParams need to have the .never_param_warn(), etc.
I don't really know, what implications a Plugin wide behavior override mechanic would have, but it might help with that above chore.

If it's not possible to catch at compile time, then it needs to be possible to catch at boot.
Whatever it is that causes error logs to get dumped need to happen as soon as possible.
I wonder if https://github.com/bevyengine/bevy/pull/16638 fixes this.

+1 from my side to reintroduce panics by default. It was actually good UX and very easy to fix. The warning is very easy to miss.


missing database.sql file....

where is database.sql file????????

heyy.. did uu got the database file??


:white_check_mark: Settle and on-chain balance assertion

Solves #28

I dont think this will automatically close the issue, have a look at https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword for keywords that would close it.

I dont think this will automatically close the issue, have a look at https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword for keywords that would close it.


assert isinstance(layer, Layer) error in ExternalAttentionRNNWrapper

Thanks for the code zimmerrol

have tried to run available code and got this error can you help me out.
super(ExternalAttentionRNNWrapper, self).init(layer, **kwargs)
assert isinstance(layer, Layer)
AssertionError

My second doubt is that is all captions are taken in sorted order

Thanks in advance
My error is
File "train.py", line 155, in
training_model, inference_model, initial_state_inference_model = create_model(le._vocabulary_size, EMBEDDING_SIZE, None, 14*14, 512)
File "/home/alok/new-way-video/model.py", line 36, in create_model
attented_encoder = ExternalAttentionRNNWrapper(encoder, return_attention=True)
File "/home/alok/myenv/lib/python3.6/site-packages/kulc/attention.py", line 516, in init
super(ExternalAttentionRNNWrapper, self).init(layer, **kwargs)
File "/home/alok/myenv/lib/python3.6/site-packages/tensorflow/python/keras/layers/wrappers.py", line 51, in init
assert isinstance(layer, Layer)
AssertionError

Same error occurs for me also..

The code in this repo (as well as the kulc library itself) was written for an old version of keras which used tensorflow=1.x. Please test to use an older version of these libraries and see if the error goes away. Sadly, I don't have a lot of time to take a look at this myself right now.

Thank you. zimmerol. i will try it out

Thanks for the reply @zimmerrol . I have solve it, it was version problem. You are correct.

Which version of keras and tensorflow  do you use  alokh Singh ??

@zimmerrol  Can you tell me why you are returning three models in return (training_model, inference_model, initial_state_inference_model). And test file you have used just inference_model, initial_state_inference_model not training
_model why???

Which version of keras and tensorflow do you use alokh Singh

Its 1.14.0
Btw can you help me out in above query??

i will try bro.

let me see bro...

@srigithub99  have you solved your problem??

No @aloksingh3110 . still stuck in there.

@srigithub99  at which line or file you are getting this error??

in the external attention wrapper class it says that the object of type external attention wrapper has no len()

can you post the screenshot of code where error is encountered

@aloksingh3110  Attached the screenshot.

@srigithub99 can you tell me the version of keras you are using is it 2.1.6

Its keras 2.3.1 @aloksingh3110

What version of tensorflow, keras, python must be used @aloksingh3110 ??

to this code i have to downgrade my keras to 2.1.6
python version 3

if you can send me your code then i can it not my system then it will be verified...

from os import listdir
from pickle import dump
#from keras.applications.vgg19 import VGG19
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
from keras.applications.vgg19 import preprocess_input
from keras.models import Model
from keras.layers import Input, Dense, RepeatVector, TimeDistributed, concatenate, Bidirectional
from keras.layers import Embedding
import os
from numpy import zeros, newaxis
import numpy as np
import keras.backend as K
from tensorflow.keras.layers import Layer, Dense, TimeDistributed, Concatenate, InputSpec, RNN,Wrapper
import numpy as np
import tensorflow as tf
class ExternalAttentionRNNWrapper(Wrapper):
def __init__(self, layer, weight_initializer="glorot_uniform", return_attention=False, **kwargs):

    print("Hello")
    assert isinstance(layer, RNN)
    print(layer)
    self.layer = layer
    self.supports_masking = True
    self.weight_initializer = weight_initializer
    self.return_attention = return_attention
    self._num_constants = None

    super(ExternalAttentionRNNWrapper, self).__init__(layer, **kwargs)

    self.input_spec = [InputSpec(ndim=3), InputSpec(ndim=3)]

def _validate_input_shape(self, input_shape):
    if len(input_shape) >= 2:
        if len(input_shape[:2]) != 2:
            raise ValueError("Layer has to receive two inputs: the temporal signal and the external signal which is constant for all time steps")
        if len(input_shape[0]) != 3:
            raise ValueError("Layer received a temporal input with shape {0} but expected a Tensor of rank 3.".format(input_shape[0]))
        if len(input_shape[1]) != 3:
            raise ValueError("Layer received a time-independent input with shape {0} but expected a Tensor of rank 3.".format(input_shape[1]))
    else:
        raise ValueError("Layer has to receive at least 2 inputs: the temporal signal and the external signal which is constant for all time steps")

def build(self, input_shape):
    self._validate_input_shape(input_shape)

    for i, x in enumerate(input_shape):
        self.input_spec[i] = InputSpec(shape=x)

    if not self.layer.built:
        self.layer.build(input_shape)
        self.layer.built = True

    temporal_input_dim = input_shape[0][-1]
    static_input_dim = input_shape[1][-1]

    if self.layer.return_sequences:
        output_dim = self.layer.compute_output_shape(input_shape[0])[0][-1]
    else:
        output_dim = self.layer.compute_output_shape(input_shape[0])[-1]

    self._W1 = self.add_weight(shape=(static_input_dim, temporal_input_dim), name="{}_W1".format(self.name), initializer=self.weight_initializer)
    self._W2 = self.add_weight(shape=(output_dim, temporal_input_dim), name="{}_W2".format(self.name), initializer=self.weight_initializer)
    self._W3 = self.add_weight(shape=(temporal_input_dim + static_input_dim, temporal_input_dim), name="{}_W3".format(self.name), initializer=self.weight_initializer)
    self._b2 = self.add_weight(shape=(temporal_input_dim,), name="{}_b2".format(self.name), initializer=self.weight_initializer)
    self._b3 = self.add_weight(shape=(temporal_input_dim,), name="{}_b3".format(self.name), initializer=self.weight_initializer)
    self._V = self.add_weight(shape=(temporal_input_dim, 1), name="{}_V".format(self.name), initializer=self.weight_initializer)

    super(ExternalAttentionRNNWrapper, self).build()

def trainable_weights(self):
    return self._trainable_weights + self.layer.trainable_weights

def non_trainable_weights(self):
    return self._non_trainable_weights + self.layer.non_trainable_weights

def compute_output_shape(self, input_shape):
    self._validate_input_shape(input_shape)

    output_shape =  self.layer.compute_output_shape(input_shape[0])

    if self.return_attention:
        if not isinstance(output_shape, list):
            output_shape = [output_shape]

        output_shape = output_shape + [(None, input_shape[1][1])]

    return output_shape

def step(self, x, states):
    h = states[0]
    # states[1] necessary?

    # comes from the constants
    X_static = states[-2]
    # equals K.dot(static_x, self._W1) + self._b2 with X.shape=[bs, L, static_input_dim]
    total_x_static_prod = states[-1]

    # expand dims to add the vector which is only valid for this time step
    # to total_x_prod which is valid for all time steps
    hw = K.expand_dims(K.dot(h, self._W2), 1)
    additive_atn = total_x_static_prod + hw
    attention = K.softmax(K.dot(additive_atn, self._V), axis=1)
    static_x_weighted = K.sum(attention * X_static, [1])

    x = K.dot(K.concatenate([x, static_x_weighted], 1), self._W3) + self._b3

    h, new_states = self.layer.cell.call(x, states[:-2])

    # append attention to the states to "smuggle" it out of the RNN wrapper
    attention = K.squeeze(attention, -1)
    h = K.concatenate([h, attention])

    return h, new_states

def call(self, x, constants=None, mask=None, initial_state=None):
    # input shape: (n_samples, time (padded with zeros), input_dim)
    input_shape = self.input_spec[0].shape

    if len(x) > 2:
        initial_state = x[2:]
        x = x[:2]
        assert len(initial_state) >= 1

    static_x = x[1]
    x = x[0]

    if self.layer.stateful:
        initial_states = self.layer.states
    elif initial_state is not None:
        initial_states = initial_state
        if not isinstance(initial_states, (list, tuple)):
            initial_states = [initial_states]
    else:
        initial_states = self.layer.get_initial_state(x)

    if not constants:
        constants = []
    constants += self.get_constants(static_x)

    last_output, outputs, states = K.rnn(
        self.step,
        x,
        initial_states,
        go_backwards=self.layer.go_backwards,
        mask=mask,
        constants=constants,
        unroll=self.layer.unroll,
        input_length=input_shape[1]
    )

    # output has at the moment the form:
    # (real_output, attention)
    # split this now up

    output_dim = self.layer.compute_output_shape(input_shape)[0][-1]
    last_output = last_output[:output_dim]

    attentions = outputs[:, :, output_dim:]
    outputs = outputs[:, :, :output_dim]

    if self.layer.stateful:
        self.updates = []
        for i in range(len(states)):
            self.updates.append((self.layer.states[i], states[i]))

    if self.layer.return_sequences:
        output = outputs
    else:
        output = last_output

    # Properly set learning phase
    if getattr(last_output, '_uses_learning_phase', False):
        output._uses_learning_phase = True
        for state in states:
            state._uses_learning_phase = True

    if self.layer.return_state:
        if not isinstance(states, (list, tuple)):
            states = [states]
        else:
            states = list(states)
        output = [output] + states

    if self.return_attention:
        if not isinstance(output, list):
            output = [output]
        output = output + [attentions]

    return output

def _standardize_args(self, inputs, initial_state, constants, num_constants):
    """Standardize `__call__` to a single list of tensor inputs.
    When running a model loaded from file, the input tensors
    `initial_state` and `constants` can be passed to `RNN.__call__` as part
    of `inputs` instead of by the dedicated keyword arguments. This method
    makes sure the arguments are separated and that `initial_state` and
    `constants` are lists of tensors (or None).
    # Arguments
    inputs: tensor or list/tuple of tensors
    initial_state: tensor or list of tensors or None
    constants: tensor or list of tensors or None
    # Returns
    inputs: tensor
    initial_state: list of tensors or None
    constants: list of tensors or None
    """
    if isinstance(inputs, list) and len(inputs) > 2:
        assert initial_state is None and constants is None
        if num_constants is not None:
            constants = inputs[-num_constants:]
            inputs = inputs[:-num_constants]
        initial_state = inputs[2:]
        inputs = inputs[:2]

    def to_list_or_none(x):
        if x is None or isinstance(x, list):
            return x
        if isinstance(x, tuple):
            return list(x)
        return [x]

    initial_state = to_list_or_none(initial_state)
    constants = to_list_or_none(constants)

    return inputs, initial_state, constants

def __call__(self, inputs, initial_state=None, constants=None, **kwargs):
    inputs, initial_state, constants = self._standardize_args(
        inputs, initial_state, constants, self._num_constants)

    if initial_state is None and constants is None:
        return super(ExternalAttentionRNNWrapper, self).__call__(inputs, **kwargs)

    # If any of `initial_state` or `constants` are specified and are Keras
    # tensors, then add them to the inputs and temporarily modify the
    # input_spec to include them.

    additional_inputs = []
    additional_specs = []
    if initial_state is not None:
        kwargs['initial_state'] = initial_state
        additional_inputs += initial_state
        self.state_spec = [InputSpec(shape=K.int_shape(state))
                           for state in initial_state]
        additional_specs += self.state_spec
    if constants is not None:
        kwargs['constants'] = constants
        additional_inputs += constants
        self.constants_spec = [InputSpec(shape=K.int_shape(constant))
                               for constant in constants]
        self._num_constants = len(constants)
        additional_specs += self.constants_spec
    # at this point additional_inputs cannot be empty
    is_keras_tensor = K.is_keras_tensor(additional_inputs[0])
    for tensor in additional_inputs:
        if K.is_keras_tensor(tensor) != is_keras_tensor:
            raise ValueError('The initial state or constants of an ExternalAttentionRNNWrapper'
                             ' layer cannot be specified with a mix of'
                             ' Keras tensors and non-Keras tensors'
                             ' (a "Keras tensor" is a tensor that was'
                             ' returned by a Keras layer, or by `Input`)')

    if is_keras_tensor:
        # Compute the full input spec, including state and constants
        full_input = inputs + additional_inputs
        full_input_spec = self.input_spec + additional_specs
        # Perform the call with temporarily replaced input_spec
        original_input_spec = self.input_spec
        self.input_spec = full_input_spec
        output = super(ExternalAttentionRNNWrapper, self).__call__(full_input, **kwargs)
        self.input_spec = self.input_spec[:len(original_input_spec)]
        return output
    else:
        return super(ExternalAttentionRNNWrapper, self).__call__(inputs, **kwargs)

def get_constants(self, x):
    # add constants to speed up calculation
    constants = [x, K.dot(x, self._W1) + self._b2]
    return constants

def get_config(self):
    config = {'return_attention': self.return_attention, 'weight_initializer': self.weight_initializer}
    base_config = super(ExternalAttentionRNNWrapper, self).get_config()
    return dict(list(base_config.items()) + list(config.items()))

from tensorflow.keras.layers import Input, Dense, LSTM, TimeDistributed, Embedding, Lambda
#from kulc.attention import ExternalAttentionRNNWrapper
from keras.models import Model
import keras.backend as K
import tensorflow as tf
W = 14
H = 14
L = W*H
D = 512
"""

use features [BS, H, W, D]

flatten [BS, H*W, D]

linear transformation [BS, H*W, D]:

flatten/reshape -> [BSHW, D]

Dense(D) -> [BSHW, D]

reshape -> [BS, H*W, D]
"""
def create_model(vocabulary_size, embedding_size, T, L, D):
image_features_input = Input(shape=(L, D), name="image_features_input")
captions_input = Input(shape=(T,), name="captions_input")
captions = Embedding(vocabulary_size, embedding_size, input_length=T)(captions_input)

averaged_image_features = Lambda(lambda x: K.mean(x, axis=1))
averaged_image_features = averaged_image_features(image_features_input)
initial_state_h = Dense(embedding_size)(averaged_image_features)
initial_state_c = Dense(embedding_size)(averaged_image_features)
image_features = TimeDistributed(Dense(D, activation="relu"))(image_features_input)
encoder = LSTM(embedding_size, return_sequences=True, return_state=True, recurrent_dropout=0.1)
attented_encoder = ExternalAttentionRNNWrapper(encoder, return_attention=True)
print(type(attented_encoder))
output = TimeDistributed(Dense(vocabulary_size, activation="softmax"), name="output")
for training purpose
attented_encoder_training_data, _, _ , _= attented_encoder([captions, image_features], initial_state=[initial_state_h, initial_state_c])
training_output_data = output(attented_encoder_training_data)
#print(training_output_data)
training_model = Model(inputs=[captions_input, image_features_input], outputs=training_output_data)
print(training_model)
return training_model

training_model = create_model(10000, 512, 28, 196, 512)

from os import listdir
from pickle import dump
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
from keras.applications.vgg19 import preprocess_input
from keras.models import Model
from keras.layers import Input, Dense, RepeatVector, TimeDistributed, concatenate, Bidirectional
from keras.layers import Embedding
#from keras.layers import *
#from keras.layers.merge import add
#import keras
import os
from numpy import zeros, newaxis
import numpy as np
import keras.backend as K
from keras.layers import Layer, Dense, TimeDistributed, Concatenate, InputSpec, RNN,Wrapper
import numpy as np
import tensorflow as tf
class ExternalAttentionRNNWrapper(Wrapper):
def __init__(self, layer, weight_initializer="glorot_uniform", return_attention=False, **kwargs):

    print("Hello")
    assert isinstance(layer, RNN)
    self.layer = layer
    self.supports_masking = True
    self.weight_initializer = weight_initializer
    self.return_attention = return_attention
    self._num_constants = None

    super(ExternalAttentionRNNWrapper, self).__init__(layer, **kwargs)

    self.input_spec = [InputSpec(ndim=3), InputSpec(ndim=3)]

def _validate_input_shape(self, input_shape):
    if len(input_shape) >= 2:
        if len(input_shape[:2]) != 2:
            raise ValueError("Layer has to receive two inputs: the temporal signal and the external signal which is constant for all time steps")
        if len(input_shape[0]) != 3:
            raise ValueError("Layer received a temporal input with shape {0} but expected a Tensor of rank 3.".format(input_shape[0]))
        if len(input_shape[1]) != 3:
            raise ValueError("Layer received a time-independent input with shape {0} but expected a Tensor of rank 3.".format(input_shape[1]))
    else:
        raise ValueError("Layer has to receive at least 2 inputs: the temporal signal and the external signal which is constant for all time steps")

def build(self, input_shape):
    self._validate_input_shape(input_shape)

    for i, x in enumerate(input_shape):
        self.input_spec[i] = InputSpec(shape=x)

    if not self.layer.built:
        self.layer.build(input_shape)
        self.layer.built = True

    temporal_input_dim = input_shape[0][-1]
    static_input_dim = input_shape[1][-1]

    if self.layer.return_sequences:
        output_dim = self.layer.compute_output_shape(input_shape[0])[0][-1]
    else:
        output_dim = self.layer.compute_output_shape(input_shape[0])[-1]

    self._W1 = self.add_weight(shape=(static_input_dim, temporal_input_dim), name="{}_W1".format(self.name), initializer=self.weight_initializer)
    self._W2 = self.add_weight(shape=(output_dim, temporal_input_dim), name="{}_W2".format(self.name), initializer=self.weight_initializer)
    self._W3 = self.add_weight(shape=(temporal_input_dim + static_input_dim, temporal_input_dim), name="{}_W3".format(self.name), initializer=self.weight_initializer)
    self._b2 = self.add_weight(shape=(temporal_input_dim,), name="{}_b2".format(self.name), initializer=self.weight_initializer)
    self._b3 = self.add_weight(shape=(temporal_input_dim,), name="{}_b3".format(self.name), initializer=self.weight_initializer)
    self._V = self.add_weight(shape=(temporal_input_dim, 1), name="{}_V".format(self.name), initializer=self.weight_initializer)

    super(ExternalAttentionRNNWrapper, self).build()

def trainable_weights(self):
    return self._trainable_weights + self.layer.trainable_weights

def non_trainable_weights(self):
    return self._non_trainable_weights + self.layer.non_trainable_weights

def compute_output_shape(self, input_shape):
    self._validate_input_shape(input_shape)

    output_shape =  self.layer.compute_output_shape(input_shape[0])

    if self.return_attention:
        if not isinstance(output_shape, list):
            output_shape = [output_shape]

        output_shape = output_shape + [(None, input_shape[1][1])]

    return output_shape

def step(self, x, states):
    h = states[0]
    # states[1] necessary?

    # comes from the constants
    X_static = states[-2]
    # equals K.dot(static_x, self._W1) + self._b2 with X.shape=[bs, L, static_input_dim]
    total_x_static_prod = states[-1]

    # expand dims to add the vector which is only valid for this time step
    # to total_x_prod which is valid for all time steps
    hw = K.expand_dims(K.dot(h, self._W2), 1)
    additive_atn = total_x_static_prod + hw
    attention = K.softmax(K.dot(additive_atn, self._V), axis=1)
    static_x_weighted = K.sum(attention * X_static, [1])

    x = K.dot(K.concatenate([x, static_x_weighted], 1), self._W3) + self._b3

    h, new_states = self.layer.cell.call(x, states[:-2])

    # append attention to the states to "smuggle" it out of the RNN wrapper
    attention = K.squeeze(attention, -1)
    h = K.concatenate([h, attention])

    return h, new_states

def call(self, x, constants=None, mask=None, initial_state=None):
    # input shape: (n_samples, time (padded with zeros), input_dim)
    input_shape = self.input_spec[0].shape

    if len(x) > 2:
        initial_state = x[2:]
        x = x[:2]
        assert len(initial_state) >= 1

    static_x = x[1]
    x = x[0]

    if self.layer.stateful:
        initial_states = self.layer.states
    elif initial_state is not None:
        initial_states = initial_state
        if not isinstance(initial_states, (list, tuple)):
            initial_states = [initial_states]
    else:
        initial_states = self.layer.get_initial_state(x)

    if not constants:
        constants = []
    constants += self.get_constants(static_x)

    last_output, outputs, states = K.rnn(
        self.step,
        x,
        initial_states,
        go_backwards=self.layer.go_backwards,
        mask=mask,
        constants=constants,
        unroll=self.layer.unroll,
        input_length=input_shape[1]
    )

    # output has at the moment the form:
    # (real_output, attention)
    # split this now up

    output_dim = self.layer.compute_output_shape(input_shape)[0][-1]
    last_output = last_output[:output_dim]

    attentions = outputs[:, :, output_dim:]
    outputs = outputs[:, :, :output_dim]

    if self.layer.stateful:
        self.updates = []
        for i in range(len(states)):
            self.updates.append((self.layer.states[i], states[i]))

    if self.layer.return_sequences:
        output = outputs
    else:
        output = last_output

    # Properly set learning phase
    if getattr(last_output, '_uses_learning_phase', False):
        output._uses_learning_phase = True
        for state in states:
            state._uses_learning_phase = True

    if self.layer.return_state:
        if not isinstance(states, (list, tuple)):
            states = [states]
        else:
            states = list(states)
        output = [output] + states

    if self.return_attention:
        if not isinstance(output, list):
            output = [output]
        output = output + [attentions]

    return output

def _standardize_args(self, inputs, initial_state, constants, num_constants):
    """Standardize `__call__` to a single list of tensor inputs.
    When running a model loaded from file, the input tensors
    `initial_state` and `constants` can be passed to `RNN.__call__` as part
    of `inputs` instead of by the dedicated keyword arguments. This method
    makes sure the arguments are separated and that `initial_state` and
    `constants` are lists of tensors (or None).
    # Arguments
    inputs: tensor or list/tuple of tensors
    initial_state: tensor or list of tensors or None
    constants: tensor or list of tensors or None
    # Returns
    inputs: tensor
    initial_state: list of tensors or None
    constants: list of tensors or None
    """
    if isinstance(inputs, list) and len(inputs) > 2:
        assert initial_state is None and constants is None
        if num_constants is not None:
            constants = inputs[-num_constants:]
            inputs = inputs[:-num_constants]
        initial_state = inputs[2:]
        inputs = inputs[:2]

    def to_list_or_none(x):
        if x is None or isinstance(x, list):
            return x
        if isinstance(x, tuple):
            return list(x)
        return [x]

    initial_state = to_list_or_none(initial_state)
    constants = to_list_or_none(constants)

    return inputs, initial_state, constants

def __call__(self, inputs, initial_state=None, constants=None, **kwargs):
    inputs, initial_state, constants = self._standardize_args(
        inputs, initial_state, constants, self._num_constants)

    if initial_state is None and constants is None:
        return super(ExternalAttentionRNNWrapper, self).__call__(inputs, **kwargs)

    # If any of `initial_state` or `constants` are specified and are Keras
    # tensors, then add them to the inputs and temporarily modify the
    # input_spec to include them.

    additional_inputs = []
    additional_specs = []
    if initial_state is not None:
        kwargs['initial_state'] = initial_state
        additional_inputs += initial_state
        self.state_spec = [InputSpec(shape=K.int_shape(state))
                           for state in initial_state]
        additional_specs += self.state_spec
    if constants is not None:
        kwargs['constants'] = constants
        additional_inputs += constants
        self.constants_spec = [InputSpec(shape=K.int_shape(constant))
                               for constant in constants]
        self._num_constants = len(constants)
        additional_specs += self.constants_spec
    # at this point additional_inputs cannot be empty
    is_keras_tensor = K.is_keras_tensor(additional_inputs[0])
    for tensor in additional_inputs:
        if K.is_keras_tensor(tensor) != is_keras_tensor:
            raise ValueError('The initial state or constants of an ExternalAttentionRNNWrapper'
                             ' layer cannot be specified with a mix of'
                             ' Keras tensors and non-Keras tensors'
                             ' (a "Keras tensor" is a tensor that was'
                             ' returned by a Keras layer, or by `Input`)')

    if is_keras_tensor:
        # Compute the full input spec, including state and constants
        full_input = inputs + additional_inputs
        full_input_spec = self.input_spec + additional_specs
        # Perform the call with temporarily replaced input_spec
        original_input_spec = self.input_spec
        self.input_spec = full_input_spec
        output = super(ExternalAttentionRNNWrapper, self).__call__(full_input, **kwargs)
        self.input_spec = self.input_spec[:len(original_input_spec)]
        return output
    else:
        return super(ExternalAttentionRNNWrapper, self).__call__(inputs, **kwargs)

def get_constants(self, x):
    # add constants to speed up calculation
    constants = [x, K.dot(x, self._W1) + self._b2]
    return constants

def get_config(self):
    config = {'return_attention': self.return_attention, 'weight_initializer': self.weight_initializer}
    base_config = super(ExternalAttentionRNNWrapper, self).get_config()
    return dict(list(base_config.items()) + list(config.items()))

from tensorflow.keras.layers import Input, Dense, LSTM, TimeDistributed, Embedding, Lambda
#from kulc.attention import ExternalAttentionRNNWrapper
from keras.models import Model
import keras.backend as K
import tensorflow as tf
W = 14
H = 14
L = W*H
D = 512
"""

use features [BS, H, W, D]

flatten [BS, H*W, D]

linear transformation [BS, H*W, D]:

flatten/reshape -> [BSHW, D]

Dense(D) -> [BSHW, D]

reshape -> [BS, H*W, D]
"""
def create_model(vocabulary_size, embedding_size, T, L, D):
image_features_input = Input(shape=(L, D), name="image_features_input")
captions_input = Input(shape=(T,), name="captions_input")
captions = Embedding(vocabulary_size, embedding_size, input_length=T)(captions_input)

averaged_image_features = Lambda(lambda x: K.mean(x, axis=1))
averaged_image_features = averaged_image_features(image_features_input)
initial_state_h = Dense(embedding_size)(averaged_image_features)
initial_state_c = Dense(embedding_size)(averaged_image_features)
image_features = TimeDistributed(Dense(D, activation="relu"))(image_features_input)
encoder = LSTM(embedding_size, return_sequences=True, return_state=True, recurrent_dropout=0.1)
attented_encoder = ExternalAttentionRNNWrapper(encoder, return_attention=True)
output = TimeDistributed(Dense(vocabulary_size, activation="softmax"), name="output")
for training purpose
attented_encoder_training_data, _, _ , _= attented_encoder([captions, image_features], initial_state=[initial_state_h, initial_state_c])
training_output_data = output(attented_encoder_training_data)
#print(training_output_data)
training_model = Model(inputs=[captions_input, image_features_input], outputs=training_output_data)
print(training_model)
return training_model

training_model = create_model(10000, 512, 28, 196, 512)

from os import listdir
from pickle import dump
#from keras.applications.vgg19 import VGG19
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
from keras.applications.vgg19 import preprocess_input
from keras.models import Model
from keras.layers import Input, Dense, RepeatVector, TimeDistributed, concatenate, Bidirectional
from keras.layers import Embedding
#from keras.layers import *
#from keras.layers.merge import add
#import keras
import os
from numpy import zeros, newaxis
import numpy as np

import keras.backend as K
from keras.layers import Layer, Dense, TimeDistributed, Concatenate, InputSpec, RNN,Wrapper
import numpy as np
import tensorflow as tf
class ExternalAttentionRNNWrapper(Wrapper):
def __init__(self, layer, weight_initializer="glorot_uniform", return_attention=False, **kwargs):

    print("Hello")
    assert isinstance(layer, RNN)
    self.layer = layer
    self.supports_masking = True
    self.weight_initializer = weight_initializer
    self.return_attention = return_attention
    self._num_constants = None

    super(ExternalAttentionRNNWrapper, self).__init__(layer, **kwargs)

    self.input_spec = [InputSpec(ndim=3), InputSpec(ndim=3)]

def _validate_input_shape(self, input_shape):
    if len(input_shape) >= 2:
        if len(input_shape[:2]) != 2:
            raise ValueError("Layer has to receive two inputs: the temporal signal and the external signal which is constant for all time steps")
        if len(input_shape[0]) != 3:
            raise ValueError("Layer received a temporal input with shape {0} but expected a Tensor of rank 3.".format(input_shape[0]))
        if len(input_shape[1]) != 3:
            raise ValueError("Layer received a time-independent input with shape {0} but expected a Tensor of rank 3.".format(input_shape[1]))
    else:
        raise ValueError("Layer has to receive at least 2 inputs: the temporal signal and the external signal which is constant for all time steps")

def build(self, input_shape):
    self._validate_input_shape(input_shape)

    for i, x in enumerate(input_shape):
        self.input_spec[i] = InputSpec(shape=x)

    if not self.layer.built:
        self.layer.build(input_shape)
        self.layer.built = True

    temporal_input_dim = input_shape[0][-1]
    static_input_dim = input_shape[1][-1]

    if self.layer.return_sequences:
        output_dim = self.layer.compute_output_shape(input_shape[0])[0][-1]
    else:
        output_dim = self.layer.compute_output_shape(input_shape[0])[-1]

    self._W1 = self.add_weight(shape=(static_input_dim, temporal_input_dim), name="{}_W1".format(self.name), initializer=self.weight_initializer)
    self._W2 = self.add_weight(shape=(output_dim, temporal_input_dim), name="{}_W2".format(self.name), initializer=self.weight_initializer)
    self._W3 = self.add_weight(shape=(temporal_input_dim + static_input_dim, temporal_input_dim), name="{}_W3".format(self.name), initializer=self.weight_initializer)
    self._b2 = self.add_weight(shape=(temporal_input_dim,), name="{}_b2".format(self.name), initializer=self.weight_initializer)
    self._b3 = self.add_weight(shape=(temporal_input_dim,), name="{}_b3".format(self.name), initializer=self.weight_initializer)
    self._V = self.add_weight(shape=(temporal_input_dim, 1), name="{}_V".format(self.name), initializer=self.weight_initializer)

    super(ExternalAttentionRNNWrapper, self).build()

def trainable_weights(self):
    return self._trainable_weights + self.layer.trainable_weights

def non_trainable_weights(self):
    return self._non_trainable_weights + self.layer.non_trainable_weights

def compute_output_shape(self, input_shape):
    self._validate_input_shape(input_shape)

    output_shape =  self.layer.compute_output_shape(input_shape[0])

    if self.return_attention:
        if not isinstance(output_shape, list):
            output_shape = [output_shape]

        output_shape = output_shape + [(None, input_shape[1][1])]

    return output_shape

def step(self, x, states):
    h = states[0]
    # states[1] necessary?

    # comes from the constants
    X_static = states[-2]
    # equals K.dot(static_x, self._W1) + self._b2 with X.shape=[bs, L, static_input_dim]
    total_x_static_prod = states[-1]

    # expand dims to add the vector which is only valid for this time step
    # to total_x_prod which is valid for all time steps
    hw = K.expand_dims(K.dot(h, self._W2), 1)
    additive_atn = total_x_static_prod + hw
    attention = K.softmax(K.dot(additive_atn, self._V), axis=1)
    static_x_weighted = K.sum(attention * X_static, [1])

    x = K.dot(K.concatenate([x, static_x_weighted], 1), self._W3) + self._b3

    h, new_states = self.layer.cell.call(x, states[:-2])

    # append attention to the states to "smuggle" it out of the RNN wrapper
    attention = K.squeeze(attention, -1)
    h = K.concatenate([h, attention])

    return h, new_states

def call(self, x, constants=None, mask=None, initial_state=None):
    # input shape: (n_samples, time (padded with zeros), input_dim)
    input_shape = self.input_spec[0].shape

    if len(x) > 2:
        initial_state = x[2:]
        x = x[:2]
        assert len(initial_state) >= 1

    static_x = x[1]
    x = x[0]

    if self.layer.stateful:
        initial_states = self.layer.states
    elif initial_state is not None:
        initial_states = initial_state
        if not isinstance(initial_states, (list, tuple)):
            initial_states = [initial_states]
    else:
        initial_states = self.layer.get_initial_state(x)

    if not constants:
        constants = []
    constants += self.get_constants(static_x)

    last_output, outputs, states = K.rnn(
        self.step,
        x,
        initial_states,
        go_backwards=self.layer.go_backwards,
        mask=mask,
        constants=constants,
        unroll=self.layer.unroll,
        input_length=input_shape[1]
    )

    # output has at the moment the form:
    # (real_output, attention)
    # split this now up

    output_dim = self.layer.compute_output_shape(input_shape)[0][-1]
    last_output = last_output[:output_dim]

    attentions = outputs[:, :, output_dim:]
    outputs = outputs[:, :, :output_dim]

    if self.layer.stateful:
        self.updates = []
        for i in range(len(states)):
            self.updates.append((self.layer.states[i], states[i]))

    if self.layer.return_sequences:
        output = outputs
    else:
        output = last_output

    # Properly set learning phase
    if getattr(last_output, '_uses_learning_phase', False):
        output._uses_learning_phase = True
        for state in states:
            state._uses_learning_phase = True

    if self.layer.return_state:
        if not isinstance(states, (list, tuple)):
            states = [states]
        else:
            states = list(states)
        output = [output] + states

    if self.return_attention:
        if not isinstance(output, list):
            output = [output]
        output = output + [attentions]

    return output

def _standardize_args(self, inputs, initial_state, constants, num_constants):
    """Standardize `__call__` to a single list of tensor inputs.
    When running a model loaded from file, the input tensors
    `initial_state` and `constants` can be passed to `RNN.__call__` as part
    of `inputs` instead of by the dedicated keyword arguments. This method
    makes sure the arguments are separated and that `initial_state` and
    `constants` are lists of tensors (or None).
    # Arguments
    inputs: tensor or list/tuple of tensors
    initial_state: tensor or list of tensors or None
    constants: tensor or list of tensors or None
    # Returns
    inputs: tensor
    initial_state: list of tensors or None
    constants: list of tensors or None
    """
    if isinstance(inputs, list) and len(inputs) > 2:
        assert initial_state is None and constants is None
        if num_constants is not None:
            constants = inputs[-num_constants:]
            inputs = inputs[:-num_constants]
        initial_state = inputs[2:]
        inputs = inputs[:2]

    def to_list_or_none(x):
        if x is None or isinstance(x, list):
            return x
        if isinstance(x, tuple):
            return list(x)
        return [x]

    initial_state = to_list_or_none(initial_state)
    constants = to_list_or_none(constants)

    return inputs, initial_state, constants

def __call__(self, inputs, initial_state=None, constants=None, **kwargs):
    inputs, initial_state, constants = self._standardize_args(
        inputs, initial_state, constants, self._num_constants)

    if initial_state is None and constants is None:
        return super(ExternalAttentionRNNWrapper, self).__call__(inputs, **kwargs)

    # If any of `initial_state` or `constants` are specified and are Keras
    # tensors, then add them to the inputs and temporarily modify the
    # input_spec to include them.

    additional_inputs = []
    additional_specs = []
    if initial_state is not None:
        kwargs['initial_state'] = initial_state
        additional_inputs += initial_state
        self.state_spec = [InputSpec(shape=K.int_shape(state))
                           for state in initial_state]
        additional_specs += self.state_spec
    if constants is not None:
        kwargs['constants'] = constants
        additional_inputs += constants
        self.constants_spec = [InputSpec(shape=K.int_shape(constant))
                               for constant in constants]
        self._num_constants = len(constants)
        additional_specs += self.constants_spec
    # at this point additional_inputs cannot be empty
    is_keras_tensor = K.is_keras_tensor(additional_inputs[0])
    for tensor in additional_inputs:
        if K.is_keras_tensor(tensor) != is_keras_tensor:
            raise ValueError('The initial state or constants of an ExternalAttentionRNNWrapper'
                             ' layer cannot be specified with a mix of'
                             ' Keras tensors and non-Keras tensors'
                             ' (a "Keras tensor" is a tensor that was'
                             ' returned by a Keras layer, or by `Input`)')

    if is_keras_tensor:
        # Compute the full input spec, including state and constants
        full_input = inputs + additional_inputs
        full_input_spec = self.input_spec + additional_specs
        # Perform the call with temporarily replaced input_spec
        original_input_spec = self.input_spec
        self.input_spec = full_input_spec
        output = super(ExternalAttentionRNNWrapper, self).__call__(full_input, **kwargs)
        self.input_spec = self.input_spec[:len(original_input_spec)]
        return output
    else:
        return super(ExternalAttentionRNNWrapper, self).__call__(inputs, **kwargs)

def get_constants(self, x):
    # add constants to speed up calculation
    constants = [x, K.dot(x, self._W1) + self._b2]
    return constants

def get_config(self):
    config = {'return_attention': self.return_attention, 'weight_initializer': self.weight_initializer}
    base_config = super(ExternalAttentionRNNWrapper, self).get_config()
    return dict(list(base_config.items()) + list(config.items()))

from tensorflow.keras.layers import Input, Dense, LSTM, TimeDistributed, Embedding, Lambda
#from kulc.attention import ExternalAttentionRNNWrapper
from keras.models import Model
import keras.backend as K
import tensorflow as tf
W = 14
H = 14
L = W*H
D = 512
def create_model(vocabulary_size, embedding_size, T, L, D):
image_features_input = Input(shape=(L, D), name="image_features_input")
captions_input = Input(shape=(T,), name="captions_input")
captions = Embedding(vocabulary_size, embedding_size, input_length=T)(captions_input)
averaged_image_features = Lambda(lambda x: K.mean(x, axis=1))
averaged_image_features = averaged_image_features(image_features_input)
initial_state_h = Dense(embedding_size)(averaged_image_features)
initial_state_c = Dense(embedding_size)(averaged_image_features)

image_features = TimeDistributed(Dense(D, activation="relu"))(image_features_input)

encoder = LSTM(embedding_size, return_sequences=True, return_state=True, recurrent_dropout=0.1)
attented_encoder = ExternalAttentionRNNWrapper(encoder, return_attention=True)

output = TimeDistributed(Dense(vocabulary_size, activation="softmax"), name="output")

# for training purpose
attented_encoder_training_data, _, _ , _= attented_encoder([captions, image_features], initial_state=[initial_state_h, initial_state_c])
training_output_data = output(attented_encoder_training_data)
#print(training_output_data)

training_model = Model(inputs=[captions_input, image_features_input], outputs=training_output_data)
print(training_model)

return training_model

https://colab.research.google.com/drive/1e2D6bd6MLdF8CfKTrzDHQ02JUR9npWil

Posted @aloksingh3110

okay.... will inform you right now i have lectures

Okay. tqs in advance for ur concern @aloksingh3110

tensorboard==1.14.0
tensorflow==1.14.0
tensorflow-estimator==1.14.0
kulc==0.0.9
Keras==2.1.6

Keras-Applications==1.0.8
Keras-Preprocessing==1.1.0

your output size  (None ,28,10000) you will get 28 word every time is it correct can you explain me it will be better if you can share your mail id we can disscuss there

Thank you so much @aloksingh3110 . i see to it. sry for late reply.  my email id is<EMAIL_ADDRESS>

please give your email id @aloksingh3110

@srigithub99  alok.rawat478gmail.com


Allow tests to be interrupted

Currently when libnetwork tests are run inside a container
you cannot interrupt them in the middle by pressing ctrl-c
even though all the tests run in foreground. Fix this by running
tests by wrapping the make invocation inside the container
with a shell scripts which installs the SIGINT handler.
Without the handler the kernel does not deliver signals
to the process with PID 1(which in this case was make itself)
and hence make could never be interrupted. With this fix
we capture SIGINT in the shell script and re-raise it in the
the child process (which is make) and that makes the make
interruptible.
Signed-off-by: Jana Radhakrishnan<EMAIL_ADDRESS>

:+1: thanks :)


[v4.4.1] Removed the unnecessary namespace modification

#50  👈
dev

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @GoodM4ven and the rest of your teammates on  Graphite


tb fails for some axi pulse regs

After introduction of pipe stages in uvvm axi bfm, pulse regs with a single cycle pulse is returning to reset value before a check can be done. Solved, by modyfing axi bfm config.


squeezenet pre-train

There is a squeezenet.py in a model directory.
Could you please share pre-train model for squeezenet architecture?
what is the LFW accuracy.

@Alireza-Akhavan
I have trained a model of squeezenet on VGG Face 2 Dataset.

Here is the result after running validation on LFW:
Model directory: ../models/20180204-160909
Metagraph file: model-20180204-160909.meta
Checkpoint file: model-20180204-160909.ckpt-266000
Runnning forward pass on LFW images
Accuracy: 0.982+-0.008
Validation rate: 0.91933+-0.02102 @ FAR=0.00133
Area Under Curve (AUC): 0.998
Equal Error Rate (EER): 0.017

You can download it here if you find it useful.
https://drive.google.com/file/d/1phGtQBEAh8L2GsKXByagD1sLQnFQ8hjd/view?usp=sharing

How did you freeze graph of SqueezeNet architecture and export to .pb file?

@yipsang
Thanks for sharing your pretrained squeeze net, it's a great achievement
It would be very helpful if you could share the way you trained the squeeze net
You trained it with softmax or triplet loss ?
How about the learning rate ?
Thanks advance

Hi @yipsang ,
I am so thankful for your cooperation.
As @hgffly asked, could you please give me more information about the train information?
You have used softmax or triplet loss ? and about parameters like LR?
Thanks

Hi @yipsang I tried your model, but met with following issue:
FailedPreconditionError (see above for traceback): Attempting to use uninitialized value squeezenet/conv1/BatchNorm/beta
         [[Node: squeezenet/conv1/BatchNorm/beta/read = Identity[T=DT_FLOAT, _class=["loc:@squeezenet/conv1/BatchNorm/beta"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](squeezenet/conv1/BatchNorm/beta)]]

update the freeze_graph.py a bit, and now the model provided by @yipsang could work successfully.

@hgffly @Alireza-Akhavan
I used center loss to train. And here is the hyperparameters I've user:
--keep_probability 0.8 --max_nrof_epochs 2000 --weight_decay 5e-5 --random_crop --random_flip --learning_rate_decay_factor 0.5 --learning_rate 0.1 --learning_rate_decay_epochs 25 --center_loss_factor 1e-2 --center_loss_alfa 0.9 --optimizer RMSPROP
@zhenglaizhang I haven't come across with the error you had before, glad to hear you've solved it.

@yipsang Have you ever tried to train MobileNet or ShuffelNet?

@yipsang , very thankful for your sharing

@zhenglaizhang I also have your problem. How did you solve that? Thank you very much.

Hi @yipsang , thanks for great work.
Can you explain a bit more about face alignment, --image_size, --margin information when training with VGGFace2.
Thank you.

I'm very new to all of this tensorflow, training, and freezing. I'm attempting to compile the trained squeezenet graph provided in this issue to run on the Google AIY Vision Kit.
Using their compiler I've tried running this command:
./bonnet_model_compiler.par --frozen_graph_path 20180204-160909/20180204-16090.pb --output_graph_path vggface2_sqeezenet.binaryproto --input_tensor_name input --output_tensor_names embeddings --input_tensor_size 160 --debug
But I'm getting this error:
2018-06-24 19:57:47.484325: I external/org_tensorflow/tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before general graph transformations: 1207 operators, 1562 arrays (0 quantized)
2018-06-24 19:57:47.526755: I external/org_tensorflow/tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] After general graph transformations pass 1: 989 operators, 1360 arrays (0 quantized)
2018-06-24 19:57:47.564350: I external/org_tensorflow/tensorflow/contrib/lite/toco/graph_transformations/graph_transformations.cc:39] Before dequantization graph transformations: 989 operators, 1360 arrays (0 quantized)
2018-06-24 19:57:47.586820: F external/org_tensorflow/tensorflow/contrib/lite/toco/toco_tooling.cc:46] Check failed: unsupported_ops.empty() These unsupported ops were not removed by graph transformations: Prod, Reciprocal, SquaredDifference, VariableV2

I've tried looking up the unsupported_ops.empty() online, but could not parse what was needed to be done to get past this error (or if anything could be done). I'm not even sure if I'm running the compiler on the correct file, or if I need to freeze the graph (or is the 20180204-16090.pb file the already frozen graph)...
Thanks for any help

How to define squeezenet model in model_def?
when i am giving --model_def models.squeezenet it is giving me this error
train_softmax.py: error: unrecognized arguments: models.squeezenet
I am new to this.Please help

Hi,
@yipsang i tried to convert 20180204-16090.pb into .binaryproto for AIY vision tool kit ,
where it is showing error :
Check failed: unsupported_ops.empty() These unsupported ops were not removed by graph transformations: FIFOQueueV2, Prod, QueueDequeueUpToV2, Reciprocal, SquaredDifference, VariableV2
How to resolve it ??
Thanks,

update the freeze_graph.py a bit, and now the model provided by @yipsang could work successfully.

Can you please share what you changed to make the model working?

@yipsang How do you get the evaluation metric values? I got the following errors when running the command.
c02wj0huhv2t:facenet jintao01$ python3 src/validate_on_lfw.py dataset/lfw/lfw_mtcnnpy_160 20180204-160909 --distance_metric 1 --use_flipped_images --subtract_mean --use_fixed_image_standardization
2018-11-02 17:08:09.928446: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
Model directory: 20180204-160909
Metagraph file: model-20180204-160909.meta
Checkpoint file: model-20180204-160909.ckpt-266000
Traceback (most recent call last):
File "/Users/jintao01/.local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 667, in import_graph_def
op._add_input(source_tensor, dtype=input_type)
File "/Users/jintao01/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1898, in _add_input
(tensor.dtype.name, dtype.name))
TypeError: Cannot convert a tensor of type int32 to an input of type int64
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "src/validate_on_lfw.py", line 164, in
main(parse_arguments(sys.argv[1:]))
File "src/validate_on_lfw.py", line 73, in main
facenet.load_model(args.model, input_map=input_map)
File "/Users/jintao01/Documents/facenet/src/facenet.py", line 382, in load_model
saver = tf.train.import_meta_graph(os.path.join(model_exp, meta_file), input_map=input_map)
File "/Users/jintao01/.local/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1927, in import_meta_graph
**kwargs)
File "/Users/jintao01/.local/lib/python3.6/site-packages/tensorflow/python/framework/meta_graph.py", line 741, in import_scoped_meta_graph
producer_op_list=producer_op_list)
File "/Users/jintao01/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 432, in new_func
return func(*args, **kwargs)
File "/Users/jintao01/.local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 671, in import_graph_def
node, 'Input tensor %r %s' % (input_name, te)))
ValueError: graph_def is invalid at node 'Reshape': Input tensor 'label_batch:0' Cannot convert a tensor of type int32 to an input of type int64.

@yipsang  Which version of validate_on_lfw.py did you use? How did you run the command? Thank you!

My problem fixed.

@tfabio In freeze_graph.py you add this line in whitelist_names,

@zhenglaizhang  :
I have the same error of "Attempting to use uninitialized value".
How did you solve this problem?
The error message as following :
FailedPreconditionError (see above for traceback): Attempting to use uninitialized value squeezenet/conv1/weights
[[Node: squeezenet/conv1/weights/read = IdentityT=DT_FLOAT, _class=["loc:@squeezenet/conv1/weights"], _device="/job:localhost/replica:0/task:0/device:GPU:0"]]
Thanks for your help.


align with manifest bundle KEP

I wasn't sure where else to post this, but it looks like something similar is cooking up in this KEP: https://github.com/kubernetes/enhancements/pull/1481/files

Thanks for the heads up! We will keep an eye on this.

Heads up that we merged the KEP.
There's interest in getting this to work with kubebuilder-declarative-pattern and kops as next steps.

As an update here, seems like there is an ongoing discussion from @cppforlife with regard to the KEP and whether the KEP could be amended to change the metadata directory into a hidden directory.

@cppforlife Any follow up that can be done on your comment here to potentially amend the KEP?

@cppforlife Any follow up that can be done on your comment here to potentially amend the KEP?

@danielhelfand bumped the thread there. ultimately we are compatible with that format since folks can just include metadata directory if they need to.

@danielhelfand bumped the thread there. ultimately we are compatible with that format since folks can just include metadata directory if they need to.

Going to close this then. But please feel free to repoen if there is anything more to be done.

Going to close this then. But please feel free to repoen if there is anything more to be done.


Check whether logging level is enabled or not

Hi Winston Team,
Is there a method where we can check whether a particular log level is enabled or not?
For example : logger.isDebugEnabled ?

Same request as #905 ?

Yes its the same.

Issue should be closed if it's a duplicate.

Thanks all – definitely a duplicate of #905


Fix HTML Assistant closing when element deselected

[Issue] https://github.com/Samsung/TAU-Design-Editor/issues/407
[Problem] HTML assistant not saving content when DE squared area click.
[Solution] Fixed callback call which should be done after promises resolve.
Signed-off-by: Lukasz Slachciak<EMAIL_ADDRESS>

fixed eslint error

improved commit message


unaryMinus operation for AnyInt hierarchy

Description

Discussed in https://github.com/kotools/types/discussions/40.

We would like to introduce the following unaryMinus operations for the AnyInt hierarchy:
/** Returns the negative of this integer. */
operator fun AnyInt.unaryMinus(): Int
operator fun NonZeroInt.unaryMinus(): NonZeroInt
operator fun PositiveInt.unaryMinus(): NegativeInt
operator fun NegativeInt.unaryMinus(): PositiveInt
operator fun StrictlyPositiveInt.unaryMinus(): StrictlyNegativeInt
operator fun StrictlyNegativeInt.unaryMinus(): StrictlyPositiveInt

These functions should be part of the experimental API!

Checklist

Tests should be done at least on the JVM platform!

[x] Wait for the issue #66 to be resolved for using the ExperimentalNumberApi annotation.
[x] Wait for the issue #82 to be resolved for working on safer commits.
[ ] Implement and test it for the AnyInt type.
[ ] Implement and test it for the NonZeroInt type.
[ ] Implement and test it for the PositiveInt type.
[ ] Implement and test it for the NegativeInt type.
[ ] Implement and test it for the StrictlyPositiveInt type.
[ ] Implement and test it for the StrictlyNegativeInt type.
[ ] Refactor code.
[ ] Check and update the public API binaries.
[ ] Update the Unreleased section in the changelog.

Can I take this one ?

Can I take this one ?

Sure, I will assigne it to you.

Can I take this one ?

Sure, I will assign it to you!

Because this issue will be included in Kotools Types 4.2.0, make sure to add the @SinceKotoolsTypes("4.2") annotation on new declarations introduced by this issue.
Also, if you use IntellIJ, I suggest you to run:

the Documentation configuration for generating the documentation with auto-reload.
the JVM test configuration for testing your code.

@MichaelStH Please remember to pull changes from the main branch and base your branch on it before implementing it: I've added an .editorconfig file for normalizing the style code of this project.

@MichaelStH Please remember to pull changes from the main branch and base your branch on its latest commit before implementing it: I've cleaned the Git history until the tag 4.2.0-alpha.
Sorry for the inconvenience.

@MichaelStH Quick update! 🚨
I'm currently verifying each commits for enhancing the security of the project, and because it involves updating the Git history, I'm gonna mark this issue as blocked by the issue #82.
If you've already published some work on the corresponding branch (feature/54 for example), please push your changes to the repository. I will rebase it once this security work is done.
If not, then do nothing. I will put a new update on this issue when the issue #82 will be completed.
Sorry again for the inconvenience.

@MichaelStH The issue #82 is done! You can now work on this issue.


[BUG] Dryer done sensor erronously triggers when device goes from unavailable to on.

Describe the bug
The binary sensor created (in my case binary_sensor.dryer_dry_completed) will erroneously trigger to an on state if the dryer entity becomes unavailable then comes back online in an off state.  This triggers automations like sending notifications that the dryer is done when no laundry is being done.
Expected behavior
The binary sensor should not switch to on if the previous state was unavailable, only a known running state.
Screenshots

Environment details:

Environment (HASSIO, Raspbian, etc): HA Docker
Home Assistant version installed:0.117.6
Component version installed: 0.5.10
Last know working version:
LG device type and model with issue: RV13B6ES_D_US_WIFI-Dryer
LG devices connected (list):

How easy is this to fix? If it’s just 2 lines, want to patch it yourself?
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10
From: Aaron<EMAIL_ADDRESS>Sent: Wednesday, November 18, 2020 8:40 AM
To<EMAIL_ADDRESS>Cc<EMAIL_ADDRESS>Subject: [ollo69/ha-smartthinq-sensors] [BUG] Dryer done sensor erronously triggers when device goes from unavailable to on. (#109)
Describe the bug
The binary sensor created (in my case binary_sensor.dryer_dry_completed) will erroneously trigger to an on state if the dryer becomes unavailable then comes back online. This triggers automations like sending notifications that the dryer is done when no laundry is being done.
Expected behavior
The binary sensor should not switch to on if the previous state was unavailable, only a known running state.
Screenshots
[Screenshot from 2020-11-18 08-35-55]https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F109865%2F99559080-3f9d7f00-2979-11eb-8432-358871a6091b.png&data=04|01||4ccd25202db64522002508d88be0b4da|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637413144503083768|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=ta6WBaxcODS4V%2FnA0%2FtP9GVn5YWHRML554FaKW7WjlQ%3D&reserved=0
Environment details:

Environment (HASSIO, Raspbian, etc): HA Docker
Home Assistant version installed:0.117.6
Component version installed: 0.5.10
Last know working version:
LG device type and model with issue: RV13B6ES_D_US_WIFI-Dryer
LG devices connected (list):

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Follo69%2Fha-smartthinq-sensors%2Fissues%2F109&data=04|01||4ccd25202db64522002508d88be0b4da|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637413144503093760|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=L5w40V%2BvCma%2FJYUIGWu1jRChsRoP3Cc85YuJaYYP5Cs%3D&reserved=0, or unsubscribehttps://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACR3DNUZR7MZRPXDUHHM5K3SQP2JBANCNFSM4T2GXZYQ&data=04|01||4ccd25202db64522002508d88be0b4da|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|637413144503103751|Unknown|TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D|1000&sdata=kv4WXRW5Dw1yONHgxlz%2F%2FV2f7kMb0Qf38V1%2B%2FBXNgEY%3D&reserved=0.

From taking a quick look I don't think it's simple to solve.  The binary sensor will always return True when the dryer goes offline and comes back because it's only looking at the previous and current state reported by the api.  The api doesn't have an unavailable state so it's just reporting the previous date as dryer ended.
I can't think of a good way at the moment for the binary_sensor also to be able to check the previous state of a different entity, sensor.dryer to determine if it changed from unavailable -> off.
It might be easier for my use case to add a 2nd conditional check in my automation when the binary_sensor changes to on to also check that the dryer sensor's previous state wasn't unavailable.

Was there ever a solution to this? This appears to have started happening to both my washer and dryer over the past week or two. Both are setting the washer/dryer completed sensor to "on" at what appears to be random times. Seems to 5 times over the course of one night when we were sleeping, so nothing is happening on the washer/dryer as far as turning on/off or doing laundry. Happens during the day as well, but night time is for sure when I know nothing is happening with these appliances.

I"m using Node-RED, but basically I check that after the binary sensor changes to on I check the previous state (of the dryer) and ensure it wasn't previously unavailable and transitioned to off.

Here's the above flow you can import (if you use node-red)
[{"id":"94d9fc87.8f15c8","type":"trigger-state","z":"b25f2499.0cdcb","name":"Dryer Finished","server":"b454cc2c.3067b","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.dryer_dry_completed","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"bool","comparatorValue":"true","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","comparatorType":"is","comparatorValueDatatype":"bool","comparatorValue":"false","propertyValue":"old_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","comparatorType":"is_not","comparatorValueDatatype":"str","comparatorValue":"unavailable","propertyValue":"old_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"habool","x":120,"y":320,"wires":[["6bd5c0cd.8d6c98"],[]]},{"id":"6bd5c0cd.8d6c98","type":"api-get-history","z":"b25f2499.0cdcb","name":"Get Dryer State History (24h)","server":"b454cc2c.3067b","startdate":"","enddate":"","entityid":"sensor.dryer","entityidtype":"is","useRelativeTime":true,"relativeTime":"24h","flatten":true,"output_type":"array","output_location_type":"msg","output_location":"payload","x":360,"y":320,"wires":[["714af924.e183e8"]]},{"id":"714af924.e183e8","type":"function","z":"b25f2499.0cdcb","name":"Was Dryer Offline?","func":"const history = msg.payload\nconst size = history.length\nconst currentState = history[size - 1]\nconst previousState = history[size - 2]\n\nif (currentState.state === 'off' && previousState.state === 'unavailable') {\n    node.status({fill: 'red', shape: 'ring', text: 'Was unavailable'})\n return [msg, null]    \n}\nnode.status({fill: 'green', shape: 'ring', text: 'Was available!'});\nreturn [null, msg]","outputs":2,"noerr":0,"initialize":"","finalize":"","x":610,"y":320,"wires":[[],["c51357b7.db5e2"]],"inputLabels":["History message"],"outputLabels":["Was unavailable","Was available"]},{"id":"b454cc2c.3067b","type":"server","name":"Home Assistant","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

I'm not entirely sure how to accomplish this using just yaml automations, but hopefully the above helps.

Excellent, I'll give it a try. Thank you. Weird that they just randomly
started doing this. It's been running fine for months.
On Wed, Feb 10, 2021, 10:16 PM Aaron Godfrey<EMAIL_ADDRESS>wrote:

I"m using Node-RED, but basically I check that after the binary sensor
changes to on I check the previous state (of the dryer) and ensure it
wasn't previously unavailable and transitioned to off.
[image: image]
https://user-images.githubusercontent.com/109865/107599009-1e44db80-6bd4-11eb-90be-1866ce88ee7a.png
Here's the above flow you can import (if you use node-red)
[{"id":"94d9fc87.8f15c8","type":"trigger-state","z":"b25f2499.0cdcb","name":"Dryer Finished","server":"b454cc2c.3067b","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.dryer_dry_completed","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"bool","comparatorValue":"true","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","comparatorType":"is","comparatorValueDatatype":"bool","comparatorValue":"false","propertyValue":"old_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","comparatorType":"is_not","comparatorValueDatatype":"str","comparatorValue":"unavailable","propertyValue":"old_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"habool","x":120,"y":320,"wires":[["6bd5c0cd.8d6c98"],[]]},{"id":"6bd5c0cd.8d6c98","type":"api-get-history","z":"b25f2499.0cdcb","name":"Get Dryer State History (24h)","server":"b454cc2c.3067b","startdate":"","enddate":"","entityid":"sensor.dryer","entityidtype":"is","useRelativeTime":true,"relativeTime":"24h","flatten":true,"output_type":"array","output_location_type":"msg","output_location":"payload","x":360,"y":320,"wires":[["714af924.e183e8"]]},{"id":"714af924.e183e8","type":"function","z":"b25f2499.0cdcb","name":"Was Dryer Offline?","func":"const history = msg.payload\nconst size = history.length\nconst currentState = history[size - 1]\nconst previousState = history[size - 2]\n\nif (currentState.state === 'off' && previousState.state === 'unavailable') {\n    node.status({fill: 'red', shape: 'ring', text: 'Was unavailable'})\n return [msg, null]    \n}\nnode.status({fill: 'green', shape: 'ring', text: 'Was available!'});\nreturn [null, msg]","outputs":2,"noerr":0,"initialize":"","finalize":"","x":610,"y":320,"wires":[[],["c51357b7.db5e2"]],"inputLabels":["History message"],"outputLabels":["Was unavailable","Was available"]},{"id":"b454cc2c.3067b","type":"server","name":"Home Assistant","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
I'm not entirely sure how to accomplish this using just yaml automations,
but hopefully the above helps.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/ollo69/ha-smartthinq-sensors/issues/109#issuecomment-777179389,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AF5DEXI3H6L4EFFVUQA7DHLS6NDZ5ANCNFSM4T2GXZYQ
.

I tried to fix this issue with last release, not sure that it work because is a very rare case due to LG server unavailability.

i same problem:
Environment (HASSIO, Raspbian, etc): Hassio
Home Assistant version installed: 2021.3.4
Component version installed: v0.6.5
Last know working version:
LG device type and model with issue: WTWS3-FL
LG devices connected (list):


README_UWU.txt should be .md

Renaming the README_UWU.txt to README_UWU.md makes it easier to read online

probably not a good idea. uwu-ing messes up html tags so it'll probably look really weird in markdown anyways


Setuptools 8.1.0 needed for a recent git change

Details in https://github.com/pypa/setuptools_scm/issues/1038
Needed to fix breakage in conda/conda CI for Python <=3.10, I think? https://github.com/conda/conda/actions/runs/9881920885/job/27293763034?pr=14030

setuptools_scm 8.1.0 is available on the defaults channel

Thanks!


eth2ResponseTimer does not throw error at the right time

Describe the bug
eth2ResponseTimer is where we handle TTFB_TIMEOUT and RESP_TIMEOUT but it doesn't throw error at the right time
2020-10-21 12:07:05 [NETWORK]       ^[[36mverbose^[[39m: sending beacon_blocks_by_range request to 16Uiu2HAmQRvkQZcF8enhAiUC7rnzrooYbqRmU5hSRKkPyYufwobZ requestId=0920a136136769b4, encoding=ssz_snappy
2020-10-21 12:07:19 [NETWORK]       ^[[36mverbose^[[39m: got stream to 16Uiu2HAmQRvkQZcF8enhAiUC7rnzrooYbqRmU5hSRKkPyYufwobZ requestId=0920a136136769b4, encoding=ssz_snappy
2020-10-21 12:21:32 [NETWORK]       ^[[36mverbose^[[39m: peer disconnected 16Uiu2HAmQRvkQZcF8enhAiUC7rnzrooYbqRmU5hSRKkPyYufwobZ
2020-10-21 12:21:32 [NETWORK]          ^[[33mwarn^[[39m: failed to send request 0920a136136769b4 to peer 16Uiu2HAmQRvkQZcF8enhAiUC7rnzrooYbqRmU5hSRKkPyYufwobZ method=beacon_blocks_by_range, reason=response timeout

in fact it only throws error at the time the peer is disconnected and our sync has to wait for 14 minutes. I got same issue with another peer in my log as well.
We may have to wait longer if peer is disconnected after hours.
Expected behavior
eth2ResponseTimer throws error after RESP_TIMEOUT which is 10s

libp2p was upgraded, will reopen if I see it again


Stories cannot be open 2 times

Hello, once a story has been opened and closed, it is not possible to reopen it again. The paper sound is activated, but nothing appears anymore. I have to refresh my foundry page to display the story again. Any idea where it coming from ? No error appear on the consol.

Can you sau version of StoryTeller and FoundryVTT?

@Stotorm
I checked the mod's work. Everything works correctly, I have no problem opening the story as many times as I want.
Perhaps a conflict with other mods? Can you check or send a list of mods that you use?

I checked myself, and the problem seems to come from the module "PF2e Dorako UI", i have desactivate it for now, but maybe you know a solution ?

Same issue here, conflict with the dorako ui module but no errors in the console

@Stotorm @Felipecesarap
I am happy to report that this problem should be fixed in the current version 0.4.0. Sorry for the wait!


Fixed gulp-favicons implementation

Thanks so much for submitting this.
I'm fascinated by the changes. I think you mentioned discovering a bug in one of your depenencies. That must be what the whitespace/self-closing changes are about, right?
I see this error when running Gulp. Aside from that, this looks great! :smile:

Going to close this for now. Might hop back onto the gulp-favicons task someday. Thanks for your help!


Unit testing

Hi,
I have been looking at your project and it is looking good.
However, testing is the key to prevent bugs from happening and I noticed you lack tests.
I am working on a project called Ponicode, it is a VS Code extension that writes AI-generated unit tests. I think it could help you test your projects quickly.
It would be awesome if you could check it out on the VS Code Market Place, I would love to have some feedback.
Here is the link to the marketplace if you feel like trying it out: https://marketplace.visualstudio.com/items?itemName=ponicode.ponicode
Have a nice day,
Charlie.

@CharlieNoodl Thank you so much I'm sure that I will try to use it in this project and my another project Raj Lang - JS