[GET] Device Offline

Describe the bug

Recently I've been getting a lot of 'No response' messages for devices in the Home app. All my devices are controlled by switches (so just on or off).
My log shows:
[GET] Device Offline
However, the device is definitely online - I can see it is when I check the Tuya app, and can turn it on and off without an issue. Yet the Homebridge log and Home app still show it as offline/No response.
This isn't happening on one device, but randomly across my sockets. My internet connection and WiFi reach are solid.
Restarting Homebridge fixes the issue but I'm having to do daily restarts because things keep going offline.
I've seen this happen with all sockets before and a restart fixed it, but never with one or two sockets individually - and never when they're online in the Tuya app.

Steps To Reproduce

Nothing has changed in terms of setup. WiFi is the same, Homebridge settings are the same, socket locations haven't changed.
Plugin Version

0.7.1
Homebridge Config

{
           "name": "TuyaWebPlatform",
           "options": {
               "username": "REDACTED",
               "password": "REDACTED",
               "countryCode": "REDACTED",
               "platform": "tuya"
           },
           "defaults": [
               {
                   "device_type": "form"
               }
           ],
           "scenes": false,
           "platform": "TuyaWebPlatform"
       }

Device Config

Unfortunately cannot do this step. The Teckin plugs work with Tuya which works with this plugin. All devices have worked but this is an issue I've had recently.
Additional Context

Only thing not set in my config is the polling interval. I believe this was removed as a default setting not too long ago. Would this make a difference?

I have not yet seen this happen before, the device offline error indicates that the Tuya Cloud cannot reach this device, this plugin simply forwards that message.
Some things to note - this error gets triggered when there is no wifi connection to the device or when the device is powered off, could the latter be the case for you?
If your devices is registered as offline, it will take at least 5 minutes for it to update so if you remove power from one of your devices, open the home app (and see the device as offline) it can take up to 6 minutes for the home app to show the correct status again (and you might have to reopen the home app to see any change at all)

I have not yet seen this happen before, the device offline error indicates that the Tuya Cloud cannot reach this device, this plugin simply forwards that message.
Some things to note - this error gets triggered when there is no wifi connection to the device or when the device is powered off, could the latter be the case for you?
If your devices is registered as offline, it will take at least 5 minutes for it to update so if you remove power from one of your devices, open the home app (and see the device as offline) it can take up to 6 minutes for the home app to show the correct status again (and you might have to reopen the home app to see any change at all)

The device definitely isn't powered off, or out of WiFi range.
The Tuya app shows it is online and I can control the device - meanwhile Homebridge and Homekit say it's offline.
Is it possible to have a communication issue between the Tuya app and Tuya web?

The device definitely isn't powered off, or out of WiFi range.
The Tuya app shows it is online and I can control the device - meanwhile Homebridge and Homekit say it's offline.
Is it possible to have a communication issue between the Tuya app and Tuya web?

Yeah a communication issue between the Tuya Cloud and the Plugin is possible (the plugin does nothing with the Tuya App, it talks directly to Tuya's servers).
To check this you will need to provide me with the Device Config.
Please post the result of the steps under "How to check whether the api this library uses can control your device".

Yeah a communication issue between the Tuya Cloud and the Plugin is possible (the plugin does nothing with the Tuya App, it talks directly to Tuya's servers).
To check this you will need to provide me with the Device Config.
Please post the result of the steps under "How to check whether the api this library uses can control your device".

Yeah a communication issue between the Tuya Cloud and the Plugin is possible (the plugin does nothing with the Tuya App, it talks directly to Tuya's servers).
To check this you will need to provide me with the Device Config.
Please post the result of the steps under "How to check whether the api this library uses can control your device".

Here you go!
Getting credentials
Got credentials
{   'access_token': 'EUheu159457033899160ap5jVS6fIIWdf',
'expires_in': 864000,
'refresh_token': 'EUheu159457033899160ap5tb1H9HYYCZ',
'token_type': 'bearer'}
Getting devices
Got devices
{   'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': {   'devices': [   {   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfc752327a12ab46bedrkj',
'name': 'Dehumidifier'},
{   'data': {'online': True, 'state': True},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf4e38e3552b2335a1ke9m',
'name': 'Garage Dehumidifier'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfae9bcdbe57e83038rez4',
'name': 'Spare Bedroom Lamp'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfd4efd01513d33f27ge75',
'name': 'Tyre'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf2c3cb6e70282eed7u8yb',
'name': 'Ste Ice Cube'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfaf5b3182c07cf3dauuex',
'name': 'Eli Ice Cube'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf53dcc657966dc41alj5l',
'name': 'Fan'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf60e5be21f2202dd0nd6r',
'name': 'Marshmallow'}],
'scenes': []}}

Yeah a communication issue between the Tuya Cloud and the Plugin is possible (the plugin does nothing with the Tuya App, it talks directly to Tuya's servers).
To check this you will need to provide me with the Device Config.
Please post the result of the steps under "How to check whether the api this library uses can control your device".

Here you go!
Getting credentials
Got credentials
{   'access_token': 'EUheu159457033899160ap5jVS6fIIWdf',
'expires_in': 864000,
'refresh_token': 'EUheu159457033899160ap5tb1H9HYYCZ',
'token_type': 'bearer'}
Getting devices
Got devices
{   'header': {'code': 'SUCCESS', 'payloadVersion': 1},
'payload': {   'devices': [   {   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfc752327a12ab46bedrkj',
'name': 'Dehumidifier'},
{   'data': {'online': True, 'state': True},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf4e38e3552b2335a1ke9m',
'name': 'Garage Dehumidifier'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfae9bcdbe57e83038rez4',
'name': 'Spare Bedroom Lamp'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfd4efd01513d33f27ge75',
'name': 'Tyre'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf2c3cb6e70282eed7u8yb',
'name': 'Ste Ice Cube'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bfaf5b3182c07cf3dauuex',
'name': 'Eli Ice Cube'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf53dcc657966dc41alj5l',
'name': 'Fan'},
{   'data': {'online': True, 'state': False},
'dev_type': 'switch',
'ha_type': 'switch',
'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',
'id': 'bf60e5be21f2202dd0nd6r',
'name': 'Marshmallow'}],
'scenes': []}}

And is at the moment one of your devices mis-behaving (in this case stating that it is offline?) cause then we have a problem 😛
If all devices are online now; could you please re-do this process and upload the results when one of your devices is shown as offline.
Thanks for your help 😄

And is at the moment one of your devices mis-behaving (in this case stating that it is offline?) cause then we have a problem 😛
If all devices are online now; could you please re-do this process and upload the results when one of your devices is shown as offline.
Thanks for your help 😄

And is at the moment one of your devices mis-behaving (in this case stating that it is offline?) cause then we have a problem 😛
If all devices are online now; could you please re-do this process and upload the results when one of your devices is shown as offline.
Thanks for your help 😄

All good at the moment but I'll repeat it when it happens again!

And is at the moment one of your devices mis-behaving (in this case stating that it is offline?) cause then we have a problem 😛
If all devices are online now; could you please re-do this process and upload the results when one of your devices is shown as offline.
Thanks for your help 😄

All good at the moment but I'll repeat it when it happens again!

I'm having this same issue. I can control inside Smart life app but Homekit says No Response…

I'm having this same issue. I can control inside Smart life app but Homekit says No Response…

The same here, started today at noon

The same here, started today at noon

Yes, also having this issue.

Yes, also having this issue.

Same for me App works fine for all devices but HomeBridge says offline

Same for me App works fine for all devices but HomeBridge says offline

Same error happening for me here as well. 3 Devices offline in HomeBridge but visible on the Tuya app.

Same error happening for me here as well. 3 Devices offline in HomeBridge but visible on the Tuya app.

Same error happening for me here as well. 3 Devices offline in HomeBridge but visible on the Tuya app.
Also getting a ratelimiterror which I haven't seen before.
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Kitchen Downlight East] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Kitchen Downlight East] - Device Offline
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight West] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight West] - Device Offline
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight East] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight East] - Device Offline

Does not seem to be doing it anymore.

Same error happening for me here as well. 3 Devices offline in HomeBridge but visible on the Tuya app.
Also getting a ratelimiterror which I haven't seen before.
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Kitchen Downlight East] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Kitchen Downlight East] - Device Offline
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight West] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight West] - Device Offline
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight East] - Renewing cache due to RateLimitError
[07/01/2021, 10:37:00] [TuyaWebPlatform] [Upstairs Hallway Downlight East] - Device Offline

Does not seem to be doing it anymore.

Intriguing! Seems to have fixed itself for me too!

Intriguing! Seems to have fixed itself for me too!

There have been a couple of Tuya app updated (iOS) recently. I wonder whether one broke the app and the most recent one (pushed after I posted this issue) fixed it again?
I haven't had the problem again...so far.

There have been a couple of Tuya app updated (iOS) recently. I wonder whether one broke the app and the most recent one (pushed after I posted this issue) fixed it again?
I haven't had the problem again...so far.

I’m using the Smart Life app not. Tuya and had the same issue seem to be working now though

I’m using the Smart Life app not. Tuya and had the same issue seem to be working now though

Given the context of this issue and the information I got from other sources (amongst others multiple Reddit threads); it seems like there was a problem at Tuya.
Please keep me updated if this happens more often.

Given the context of this issue and the information I got from other sources (amongst others multiple Reddit threads); it seems like there was a problem at Tuya.
Please keep me updated if this happens more often.

Given the context of this issue and the information I got from other sources (amongst others multiple Reddit threads); it seems like there was a problem at Tuya.
Please keep me updated if this happens more often.

Ok, so I had it happen again this evening.
Tuya app showed all devices online and working. Home app showed my 'Tyre' as 'No Response'. Homebridge showed '[Tyre] - [GET] Device Offline' again.
I've pulled the log as you requested - it shows the tyre as online, so I guess Tuya Web is pulling the information correctly after all. That presumably means there's an issue between Tuya Web/Plugin/Homebridge/Home.
Here's the log:
Getting credentials Got credentials {   'access_token': 'EUheu159457033899160ap5vY16jtRDO3',     'expires_in': 864000,     'refresh_token': 'EUheu159457033899160ap5vdqOuyh8Xt',     'token_type': 'bearer'} Getting devices Got devices {   'header': {'code': 'SUCCESS', 'payloadVersion': 1},     'payload': {   'devices': [   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfc752327a12ab46bedrkj',                                       'name': 'Dehumidifier'},                                   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf4e38e3552b2335a1ke9m',                                       'name': 'Garage Dehumidifier'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfae9bcdbe57e83038rez4',                                       'name': 'Spare Bedroom Lamp'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfd4efd01513d33f27ge75',                                       'name': 'Tyre'},                                   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf2c3cb6e70282eed7u8yb',                                       'name': 'Ste Ice Cube'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfaf5b3182c07cf3dauuex',                                       'name': 'Eli Ice Cube'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf53dcc657966dc41alj5l',                                       'name': 'Fan'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf60e5be21f2202dd0nd6r',                                       'name': 'Marshmallow'}],                    'scenes': []}}

Further to my post above:
I restarted Homebridge and initially all devices showed as 'No Response' in Home, while Homebridge just continued to show the Tyre as offline.
Then, it changed to a different device that was offline (the fan).
I checked the log again and noticed the yellow line of text.

I decided to remove this line of code that was left over in my config:
"defaults": [                {                    "device_type": "form"                }            ],
After I did that, and restarted again, the issue has completely resolved itself.
Unsure whether that was causing an issue or not.
What do you think?

The last warning you posted is of no influence (that is also the subtle difference between a warning and an error) in this case the plugin will just ignore that specific part of your configuration.
Regarding the issue - I'll keep an eye on it cause I really don't understand what is going on here...

The last warning you posted is of no influence (that is also the subtle difference between a warning and an error) in this case the plugin will just ignore that specific part of your configuration.
Regarding the issue - I'll keep an eye on it cause I really don't understand what is going on here...

So this happened to me again just now.
Physical switch was on.
Tuya app - Shows on and is controllable
Homebridge - Shows on but is uncontrollable
Homebridge log - [GET] Device Offline
Home app - shows 'No response'
Screenshots and log below. And thank you for looking over this for me (and the others!).

Log
Getting credentials Got credentials {   'access_token': 'EUheu159457033899160ap5uJcXAfFNxT',     'expires_in': 864000,     'refresh_token': 'EUheu159457033899160ap5H9pPukNtQR',     'token_type': 'bearer'} Getting devices Got devices {   'header': {'code': 'SUCCESS', 'payloadVersion': 1},     'payload': {   'devices': [   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfc752327a12ab46bedrkj',                                       'name': 'Dehumidifier'},                                   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf4e38e3552b2335a1ke9m',                                       'name': 'Garage Dehumidifier'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfae9bcdbe57e83038rez4',                                       'name': 'Spare Bedroom Lamp'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfd4efd01513d33f27ge75',                                       'name': 'Tyre'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf2c3cb6e70282eed7u8yb',                                       'name': 'Ste Ice Cube'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfaf5b3182c07cf3dauuex',                                       'name': 'Eli Ice Cube'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf53dcc657966dc41alj5l',                                       'name': 'Fan'},                                   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf60e5be21f2202dd0nd6r',                                       'name': 'Marshmallow'}],                    'scenes': []}}

So this happened to me again just now.
Physical switch was on.
Tuya app - Shows on and is controllable
Homebridge - Shows on but is uncontrollable
Homebridge log - [GET] Device Offline
Home app - shows 'No response'
Screenshots and log below. And thank you for looking over this for me (and the others!).

Log
Getting credentials Got credentials {   'access_token': 'EUheu159457033899160ap5uJcXAfFNxT',     'expires_in': 864000,     'refresh_token': 'EUheu159457033899160ap5H9pPukNtQR',     'token_type': 'bearer'} Getting devices Got devices {   'header': {'code': 'SUCCESS', 'payloadVersion': 1},     'payload': {   'devices': [   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfc752327a12ab46bedrkj',                                       'name': 'Dehumidifier'},                                   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf4e38e3552b2335a1ke9m',                                       'name': 'Garage Dehumidifier'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfae9bcdbe57e83038rez4',                                       'name': 'Spare Bedroom Lamp'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfd4efd01513d33f27ge75',                                       'name': 'Tyre'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf2c3cb6e70282eed7u8yb',                                       'name': 'Ste Ice Cube'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bfaf5b3182c07cf3dauuex',                                       'name': 'Eli Ice Cube'},                                   {   'data': {'online': True, 'state': False},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf53dcc657966dc41alj5l',                                       'name': 'Fan'},                                   {   'data': {'online': True, 'state': True},                                       'dev_type': 'switch',                                       'ha_type': 'switch',                                       'icon': 'https://images.tuyaeu.com/smart/icon/1534306274gqn7iuvlbs5_0.jpg',                                       'id': 'bf60e5be21f2202dd0nd6r',                                       'name': 'Marshmallow'}],                    'scenes': []}}

Thanks for the report!
I'll try to validate this in the next few days.

Thanks for the report!
I'll try to validate this in the next few days.

I really can't find any glaring issues in the code and it hasn't happened for me.
I'm more and more starting to believe that the issue might be elsewhere.
I'll keep this open but don't expect a quick fix since I really don't know what to do about this 😅

I really can't find any glaring issues in the code and it hasn't happened for me.
I'm more and more starting to believe that the issue might be elsewhere.
I'll keep this open but don't expect a quick fix since I really don't know what to do about this 😅

i have a same problem.. the problem seem happened when device is turning off manually and back turn on manually (loosing electricity). In tuya app, its reconect again but in homebridge it get device Offine and in home hit get No response..
restarting homebridge fix the problem...

i have a same problem.. the problem seem happened when device is turning off manually and back turn on manually (loosing electricity). In tuya app, its reconect again but in homebridge it get device Offine and in home hit get No response..
restarting homebridge fix the problem...


Editor submenu disappears

Open a TypeScript file
Right click on the editor
Hover Peek
Wait 1 second

🐛 Submenu disappears after 1 second

started only in today's build, likely from the shadow dom changes

I believe this PR may be relevant, https://github.com/microsoft/vscode/pull/93667.


Setup "Sithub" for contribution process

Setup Github org for use for depositing contributions for review as part of the large contribution process.

edgexfoundry-holding


Embed author link points to faulty URL

Expected result: The maps page of that user
Actual result: Redirected to either login page (if not logged in) or my own public page (if logged in).
I guess it's because the URL points to username.cartodb.com/ when it probably should be username.cartodb.com/maps nowadays (due to the recent URL changes)

ping @Kartones @xavijam not sure but could be related to the public maps release?

Not related with public maps release, I feel it is related with urls change, but in any case, on it.


camera Keyboard control speed adjustment and get mouse pose from subviewer.

Hi,
I am trying to figure out moving the camera with the keyboard, but it seems like the moving speed with ctrl+up(down, left, right) is kinda slow. Is there any way to adjust the camera's moving speed? Also, it would be helpful if we could get an instruction on keyboard control for the viewer. Maybe it is hidden somewhere lol.
Also, I noticed that you show an example of getting the mouse position using register callback; however, it seems like the subviewer class can't register a UI callback (I am using the Python binding). Do you know if there is any way to achieve that?
Thanks!

Thanks for your feedback.
For now, the keyboard camera control is preliminary and does not have speed adjustment capability, but I will soon add some supports (and documentation) for better keyboard camera control.
In case of C++, you can register a callback to a sub viewer and find clicked positions like in the following snippet. I'll expose this interface to the python binding later.
auto viewer = guik::viewer();
auto sub_viewer = viewer->sub_viewer("sub_viewer");
sub_viewer->update_cube("cube", guik::Rainbow());

// Register a UI callback to the sub_viewer
sub_viewer->register_ui_callback("sub_viewer_ui_callback", [=] {
  auto& io = ImGui::GetIO();

  // We would need some more conditions to check if the mouse is on the sub_viewer window
  if (io.MouseClicked[ImGuiMouseButton_Right]) {
    const auto winpos = ImGui::GetWindowPos();
    const Eigen::Vector2i clicked_pos = {io.MousePos.x - winpos.x, io.MousePos.y - winpos.y};

    const float depth = sub_viewer->pick_depth(clicked_pos);
    if (depth > 0.0) {
      const auto pt = sub_viewer->unproject(clicked_pos, depth);
      sub_viewer->update_sphere("sphere", guik::FlatRed().translate(pt).scale(0.1));
    }
  }
});

viewer->spin();

Thanks for your quick response(I've seen your PR)! Looking forward to implementing these new features tomorrow!

I just merged the PR that implements an enhanced keyboard camera control and exposes a few UI methods to python bindings. Doc for the keyboard control can be found at https://koide3.github.io/iridescence/misc/#keyboard-shortcut.
Note that python bindings do not expose all the interfaces available in C++ for now, but I thin I will improve it later.

Thank you!
I just checked the new features, and the camera control works smoothly on my end. I will try to implement the new UI features later.
Just one more small idea, maybe it would be great to set the keyboard_control_speed as a parameter for the camera_control class so that developers can set a value to it when they start the program (also for different control methods). And also it allows users to know how fast the camera is moving through the UI.

I think it's a good and reasonable idea. I'll implement it later. Note that the keyboard control is implemented by emulating mouse input internally, and it is also possible to move the camera by directly using mouse callback methods (CameraControl::arrow and updown).
https://github.com/koide3/iridescence/blob/adf42d73526654ea9780d2bd1894efc822fbf47a/include/guik/camera/camera_control.hpp#L25

Gotcha. I am working on building an indoor point cloud explorer. In my case, using both keyboards to move and the mouse to change the view angle would be more intuitive. Currently, the keyboard control is pretty usable for my work. But in the future, I think we need some mechanism to define the keyboard state (input text, and moving standalone) to let the user move without keeping pressing the ctrl button so that the user can control the camera moving with the keyboard and mouse at the same time (WASD+mouse) like in video games.

It sounds good. I put this idea of video-game-like camera control in my TODO list. I also think it would be good to add documentation about how to implement a custom camera control using guik::CameraControl so that the user can move the camera in a way they want.

Sounds good!

I implemented a FPS-game-like camera control with the following keyboard+mouse control. I hope this would be good for users doing indoor data inspection like you :)

Thank you! I will check it on Monday and give you some feedback soon.

I tested the new FPS camera control feature, and it works great! I think there is a minor issue that needs to be fixed: 1. it is lagging (the render process camera moves even when the user releases the key) when moving the keyboard and mouse simultaneously after loading a point. 2. The camera key control moving speed can slow down a bit (we might want the speed adjustment feature applied to this control method first.

Thanks for your feedback.
Regarding 2., I slightly updated use_fps_camera_control() so that it returns the FPSCameraControl instance and the user can easily change the camera moving speed:
#include <guik/viewer/light_viewer.hpp>
#include <guik/camera/fps_camera_control.hpp>

int main(int argc, char** argv) {
  auto viewer = guik::viewer();

  auto camera = viewer->use_fps_camera_control();
  camera->set_translation_speed(0.01);
  camera->set_mouse_senstivity(0.005, 0.005);

  viewer->spin();

  return 0;
}

Regarding 1., do you mean that the camera keeps moving while the viewer is blocked by some processes?

Thanks for updating the speed feature!
Regarding 1, yes, I think the render process is slowed down when moving inside a large set of point cloud (high density). So, when I drag the mouse and press the keyboard at the same time, sometimes the viewer will tend to process one motion first than others, (or it might just drop the input sometimes.
I think we might need to adapt a mechanism that drops the input that hasn't been processed after a certain time period, to prevent users have a laggy feeling.

I got it, and I think it should be easy to make the moving speed independent of the refresh rate using ImGuiIO::DeltaTime. I'll update the code in the next weekend.

I just pushed a commit to make the camera moving speed independent of the refresh rate https://github.com/koide3/iridescence/pull/77.

I just tested the update, and it works perfectly on my end. I think we can merge this into the master branch and close the issue.

It's just merged! Your feedback was always very clear and helpful, and people like you greatly encourage me. Thanks a lot 👍


HDInsight Spark: enabling Dynamic Allocation

Enabling Spark Dynamic Allocation.

@nathan-gs,
Thanks for your contribution.
To ensure that the project team has proper rights to use your work, please complete the Contribution License Agreement at https://cla.microsoft.com.
It will cover your contributions to all Microsoft-managed open source projects.
Thanks,
Microsoft Pull Request Bot

@nathan-gs, thanks for signing the contribution license agreement. We will now validate the agreement and then the pull request.
Thanks, Microsoft Pull Request Bot

@nathan-gs : Thanks for your contribution to the Azure documentation! The author, @nitinme, has been notified to review your proposed change.

This is a much needed addition

Thanks for the contribution Nathan.
#sign-off

@nitinme @nathan-gs
The public repo is not appropriate for adding new content. If you have new content, please use the private repo, azure-docs-pr.
I'm closing this pull request so that you can add the article in the private repository.
Here's help if you need to get started in the private repo.
You can Move content between the public and private repos.
Thanks


🐛 Error in frontend when resetting a password: "The passwords do not match"

Discussed in https://github.com/tiangolo/full-stack-fastapi-template/discussions/1170

Originally posted by adnankaya April 15, 2024
Hi @tiangolo @alejsdev , there is an error on frontend I pointed in the following code. As a backend developer I only could find the problem and show it. Hopefully it helps frontend devs to fix it.
First Check

[X] I added a very descriptive title here.
[X] I used the GitHub search to find a similar question and didn't find it.
[X] I searched in the documentation/README.
[X] I already searched in Google "How to do X" and didn't find any information.
[X] I already read and followed all the tutorial in the docs/README and didn't find an answer.

Commit to Help

[X] I commit to help with one of those options 👆

Example Code
export const confirmPasswordRules = (
  getValues: () => any,
  isRequired = true,
) => {
  const rules: any = {
    validate: (value: string) => {
      // qwert123
      console.log(value);
      /*
      {
        "new_password": "qwert123",
        "confirm_password": "qwert123"
      }
      */
      console.log(getValues());
      // getValues().password is None because as we can see above log message shows only object has new_password and confirm_password keys
      return value === getValues().password || "The passwords do not match"},
  }

  if (isRequired) {
    rules.required = "Password confirmation is required"
  }

  return rules
}

Description
Open browser -> Forgot Password -> Enter Email -> Continue -> Mail (password reset link) -> http://localhost/reset-password?token=eyJhbGciOiJI... -> Set Password (Entered qwert123) / Confirm Password (Entered qwert123)
The passwords do not match error appears above the Reset Password button.
Operating System
macOS
Operating System Details
Mac Os M2
Python Version
Python 3.10.14
Additional Context
No response

This was handled in https://github.com/tiangolo/full-stack-fastapi-template/pull/1171


Support for unnamed splats

If we don't name our splats, e.g. if we are testing the route of /rcs/route-parser/158172398 with a pattern of /rcs/route-parser/*, the * splat won't be matched to 158172398 and it will return false.  Instead I'd like anonymous splats to be matched.  Related to my issues with https://github.com/snd/url-pattern/issues/24.

Thanks for writin' in.
Could you help me understand what you want? For this use case, why don't you want to name the splat?

It's part of an admin management page - the permission thing I built lets you put in * wildcards for routes, like /github/admin/* for all routes/methods with that path.   Guess I could string replace with letters of alphabet for each wildcard in this string /github/admin/* (so it'd be like a str.replace for each * with a *{{someLetterOrNumber}}.  I decided to use the url-pattern library as it more closely matched what I was looking for - except I had to then add the trailing slashes via connect-slashes in order to make it work 100%.


Improve the way we grow buffers

See https://github.com/scala/collection-strawman/pull/19#discussion_r96708309. Also, note that #18 has touched this part of the code too.

More generally we need to compare all implementations in this project with the current collections library to get the necessary bug fixes and performance improvements. This started out as a strawman proposal for a new design, we shouldn't expect that the current implementations are correct or fast.

Sometime soon we need an initial go/no-go decision on this design.  Once it's "go", or even once we anticipate it being "go", we can start worrying about correctness and performance.  (Of course if a design would prevent correctness or performance, we should evaluate it earlier.)
Anyway, with regard to buffer resizing, I usually personally use a clipped bit shift operation that uses values of size (1 << n)-1, but in some cases it is essential that we have powers of two, and it's kind of nice if the sizes always agree just to keep it conceptually simpler.  Given that array overhead is around 20 bytes and compressed pointers are 4, allocating less than 4 things into an array seems highly questionable.
In my usual fast-and-dirty benchmarking, allocating an array of AnyRef of length 4 is about 25% slower than allocating an array of length 2; 8 is about 45% slower than 4; and 16 is about 66% slower than 4, roughly consistent with an array creation model of 1.5 ns + 0.3 ns / object pointer.  Obviously this will vary by machine, but unless we're sure that we need tiny arrays only, I would say that 8 is probably the way to go.
This suggest an algorithm like
val twice = end * 2
val newSize =
  if (twice < 0) {
    if (end == Int.MaxValue) throw new Exception("TODO--write sane message")
    else Int.MaxValue
  }
  else if (twice < 8) 8
  else twice

is the way to go.  In my tests this barely slows things down at all in a tight loop.

I implemented this algorithm in bbcb391 (in the benchmark branch, because they were preventing ArrayBuffer benchmarks to run)


Parentheses are not working

Your code does not compile for me on 10.2b and 11.7, is that 12.7 thing? Looks like illegal expression, shouldn't there be then do: instead of straight up :?

Yes, sorry, we made a mistake, it does not compile :)


Support for aggrid Version 31

Prerequisites

[X] I have not leaked any internal company information.
[X] I have not posted internal links or code snippets.

Suggestion / feature request
Hi we are using ix together with aggrid.
They released their new version 31 End of last year and we would like to use some features from it.
At the moment ix only supports the the Versions 28, 29 and 30 as peer dependency
"ag-grid-community": "^28 || ^29 || ^30"
Are there any plans when the version 31 will officially be supported?
BR
Philipp

Is there any update on this? This issue has become a serious problem due to version incompatibility, and we are failing the scanning tests.  We urgently request your support. Thanks.

Hi forks the issue is on track, but you can help us. Please install the latest version (or your preferred version) and give us feedback if the styling is broken in some cases.


Can't get SAMLv2 authentication to work with Okta & PowerDNS-Admin

We have the SAML Authentication Error "invalid_response" when we connect.
On the Okta side, we have a "success" for the given authentication.
Here is the SAML configuration used (with the sensitive data hidden).
# SAML Authnetication
SAML_DEBUG=True
SAML_ENABLED=True
SAML_SIGN_REQUEST=False
SAML_ASSERTION_ENCRYPTED=False
SAML_WANT_MESSAGE_SIGNED=False
SAML_WANT_ATTRIBUTE_STATEMENT=True
SAML_PATH = os.path.join(os.path.dirname(__file__), 'saml')
SAML_METADATA_URL = "https://example.okta.com/app/example/sso/saml/metadata"
SAML_METADATA_CACHE_LIFETIME=1
SAML_IDP_SSO_BINDING = 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST'
SAML_SP_ENTITY_ID = "pdns-admin"
SAML_SP_CONTACT_NAME = 'Pdns admin contact'
SAML_SP_CONTACT_MAIL =<EMAIL_ADDRESS>#SAML_ATTRIBUTE_USERNAME="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"
SAML_ATTRIBUTE_NAME="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
SAML_ATTRIBUTE_EMAIL="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
SAML_ATTRIBUTE_GROUP="http://schemas.xmlsoap.org/claims/Group"
SAML_GROUP_ADMIN_NAME = 'PowerDNSAdmin-Administrators'
SAML_CERT = "./saml.crt"

Thank you in advance for your help.

Have you been able to get this working? And if so, could you provide a working example? If not, I'm about to try the same thing, maybe we can help each other getting it working?

If you have Okta I would recommend using OIDC.
Problem is, I am configuring OIDC right now and also can't get it to work 🙈


Incoming SMS not backing up

My incoming SMS is not backing up
everything else does  like  outgoing SMS, whats app and call logs
Please help  im using samsung Galaxy S4 Active

I am having same problem on Note 4/Android 4.4.4 - Send all my sent SMS to GMail, but NONE of my received SMS.
https://gist.github.com/brj319/ccdc88393ed124ab1168/download#file-brj319-note-4-sync-log-31615

This from version 1.5.5 and latest stable is 1.5.10. @jberkel feel free to change name of the stale label if you'd prefer something else


feat: expose issuer in local JWTs

Configures the GOTRUE_JWT_ISSUER environment variable to point to the local setup's Auth URL. This makes it easy to identify where the JWT came from and makes it easy to to use other tools like pg_graphql, graphbase and others that require the iss claim to be present.

Pull Request Test Coverage Report for Build<PHONE_NUMBER>

1 of 1 (100.0%)  changed or added relevant line in 1 file are covered.
5 unchanged lines in 1 file lost coverage.
Overall coverage decreased (-0.03%) to 57.039%

Files with Coverage Reduction
New Missed Lines
%

internal/gen/keys/keys.go
5
12.31%

Totals

Change from base Build<PHONE_NUMBER>:
-0.03%

Covered Lines:
5198

Relevant Lines:
9113

💛  - Coveralls


vehicle.flush()

Can I ask a question about :
"what situation we will use vehicle.flush() after vehicle.send_mavlink()"?

In init.py, the vehicle.flush() method is deprecated. It has been replaced by :py:func:`Vehicle.commands.upload().
You can call vehicle.upload() method after vehicle.commands.add() method.
I don't think I need to do anything else after executing vehicle.send_mavlink() because I usually set the vehicle in GUIDED mode.


Outlining: region description not shown when collapsed

I create a region with the statement #region <my_region_description>
When I collapse it I see a box (representing the collapsed region) without the description
C# example:

Python example:

From https://developercommunity.visualstudio.com/content/problem/361739/when-editing-python-regions-collapse-doesnt-show-t.html

Would very much like to see this resolved, annoying little bug 🙈


fix outdated link and shape typo in main demo

In the main demo update the outdated link to the exploratory analysis demo in the activation patching section and fix the shape typo in the transformer architecture section.

Thanks!


can robotgo  AddEvent for two or more keys  at the same time?

can robotgo  AddEvent for two or more keys  at the same time?
and every key has it's callback function ?

Please see issues/21, I will think about it or add it in future.

yes, need that

I will update it or give me a PR.


How to get the script-handler exit code from ExtendedResultCode

Hi,
I am using a script-handler in Adu update service and I am trying to decode the ExtendedResultCode of the update state. I have prepared my environment so when Adu runs the script, the script exit code will be 22. The ExtendedResultCode that I am getting is 810553366.
According to the documentation, First I should get the unsigned hex representation of it, which with my implementation below will be: "30501016".

It doesn't start with "D" or "E" but is "3"
The error code according to the documentation is the last 20 bytes which will be "01016". Now If we should transform this hex number back to the integer number. the result is 4118 which is obviously not 22 :-)
If I instead of 20 bytes, take the last 12 bytes (016) then I would get the expected result 22.

Please let me know if something in the documentation is missing, or I am doing something wrong. Thank you
public void TranslateCode(long extendedResultCode)
    {
        string hexString = ((ulong)extendedResultCode).ToString("X8", CultureInfo.InvariantCulture); // Convert to hexadecimal string
        var uHexstring = hexString.TrimStart("FFFFFFFF".ToCharArray());
        var facilityCode = uHexstring[0];
        var errorNo = UInt32.Parse(uHexstring.AsSpan(3), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
    }

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

ID: f0caa502-1413-04a4-e8cb-6fb1424291ab
Version Independent ID: 79205d17-da6c-5d21-232f-662f7ce3cebb
Content: Error codes for Device Update for Azure IoT Hub
Content Source: articles/iot-hub-device-update/device-update-error-codes.md
Service: iot-hub-device-update
GitHub Login: @chrisjlin
Microsoft Alias: lichris

@mahdighorbanpourptw
Thanks for your feedback! We will investigate and update as appropriate.

Hi, Thanks for the quick reply. I will post it there then.

It's move to here
https://github.com/Azure/iot-hub-device-update/issues/487


Perf baseline: Figure what to use for SQL Server

A baseline is an easily to setup benchmark that is known to reflect near optimal performance on any given environment. As an example, for PostgreSQL we can run some queries using pgbench.
We will use these baselines to get an idea of how far or close the .NET results are from being satisfactory with each database.

cc @geleems


Change to deploy to dev on merging into master branch

I think this PR will update geodesyml to v0.5. Upon merged, similar changes are to be made to GNSS-Site-Manager and Geodesy-Archive projects.


Fixed a single test for Workbench

There was one test that was doing nothing and it's now correct.

Shouldn't be approved before #145.

@bruno-brant I'm waiting for you to rebase with the master branch since #145 is approved and merged.

@bruno-brant I'm waiting for you to rebase with the master branch since #145 is approved and merged.

Done


pretrained models

Would you please share pretrained models on KITTI, MatterPort3D, and ScanNet for me?
you can send email to me.
Appreciate for your time.

Actually, there is no pre-trained completion model, the completion network is trained from scratch.


Can't build PIE executables for Mac

ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in ___gmpn_divexact_1 from ../../../../daemon/external_deps/macosx64-5/lib/libgmp.a(dive_1.o). To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
PIE is enabled by default and we didn't explicitly disable it when building external_deps, so probably the GMP makefile did something to mess it up.

#438 addresses the issue by disabling assembly for GMP.


Grant Application: Keysafe Network

Project Abstract

Please provide a brief description of your project here summarising key points (1-2 paragraphs).
If your application is a follow-up to a previous grant, please mention which one in the first line of the abstract and include a link to previous pull requests if applicable.

For which grant level are you applying?

[ ] Level 1:  Up to $10,000, 2 approvals
[ ] Level 2:  Up to $50,000, 3 approvals
[ ] Level 3:  Unlimited, 5 approvals (for > $100k Web3 Foundation Council approval)

Application Checklist

[x] The application template has been copied, renamed ( project_name.md) and updated.
[ ] I have read and understood the FAQs, application guidelines and announcement guidelines.
[ ] A BTC or Ethereum (DAI/USDT) address for the payment of the milestones is provided inside the application.
[ ] I have read and acknowledge the terms and conditions.
[ ] The software delivered for this grant will be released under an open-source license specified in the application.
[ ] The initial PR contains only one commit (squash and force-push if needed).
[ ] The grant will only be announced once the first milestone has been accepted.
[ ] I prefer the discussion of this application to be in a private Element/Matrix channel. My username is: @_______

How Did You Hear About our grants program?

[ ] Social Media
[ ] Hackathon
[ ] Personal Recommendation
[ ] Substrate Builders Program
[ ] Investor/VC
[ ] Online Search
[ ] Other: _______

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.0 out of 2 committers have signed the CLA.:x: huguirong:x: yyd106huguirong seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.You have signed the CLA already but the status is still pending? Let us recheck it.


Add flag to allow recording global resource config in all regions

The default configuration for SecurityHub and related AWS/CIS/PCI benchmarks expect to find global resource recording in each region - and all get rather unhappy if it's not there.  SecurityHub, specifically, complains that AWS Config is not setup properly.
Guidance from AWS on this:

They enable global recording in all regions with their provided tooling: https://github.com/awslabs/aws-securityhub-multiaccount-scripts
Note this as a best practice here (item 2): https://aws.amazon.com/blogs/security/nine-aws-security-hub-best-practices/
Recommend conditionally disabling several controls in non-primary regions (see https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-prereq-config.html#config-resource-recording) if only recording global resources in a single region.

This PR adds a flag to allow turning on global recording in all regions. Default is currently false to avoid introducing a bunch of unexpected updates, but it might in fact be better to default true.

@bharanin Thanks for the patch and useful links to the guidance!
AWS Config best practices recommends to record global resources only in one region, so I'm afraid the recommendations from AWS might be inconsistent 🤔
I'll dig into the script a little more.

I found that [AWS SecurityHub User' Guide] (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-prereq-config.html) recommended to record global resources in a single region then disable controls enforcing AWS Config enabled.
It seems disabling individual controls isn't supported through terraform though 😢
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/securityhub_standards_subscription

When you enable resource recording as part of enabling AWS Config, choose to record all resources that are supported in a given Region. You only need to record global resources in a single Region.
If you do not record global resources in all Regions, then in the Regions where you do not record global resources, you must disable the control 2.5 – Ensure AWS Config is enabled. CIS 2.5 generates failed findings in Regions where global resources are not recorded. For details about other controls that you may want to disable in Regions where global resources are not recorded, see the following topics.

@nozaq thanks for digging in on this (and more generally for your work on this module - it's a really great resource).
I do love it when the docs are all consistent 😂   fwiw, the SecurityHub recommendations seem to frame the global recording choice as a cost-saving option and note there are a bunch of other controls you need to disable as well:

CIS AWS Foundations Benchmark 1.2-1.14, 1.16, 1.20, 1.22, and 2.5 controls
To save on the cost of AWS Config, you can disable recording of global resources in all but one Region, and then disable these controls that deal with global resources in all Regions except for the Region that runs global recording.

If you disable these 1.x controls and disable recording of global resources in a particular Region, you should also disable 2.5.
This is because 2.5 requires recording of global resources in order to pass.

https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards-cis-to-disable.html
Given the mixed guidance, I'd argue it's reasonable to give module users the choice to enable in all regions.  In my use cases I'd probably rather deal with the added cost of extra recording than all the follow-up rule deactivations (especially given that we can't do this in tf).

Look like there is an issue for this feature, as well as a PR. Hopefully terraform will support it soon!

It would indeed be nice to toggle this on for all regions.  The module user then can make the choice on cost.

@bharanin  I understood tha usecase, the PR lgtm. Defaults the flag to false makes a lot of sense given all docs we have gone through, I believe 👍🏼
@lorengordon @sbower Sorry for taking a time to merge it, I'll merge it into master. Please let me know if you guys have any issues, thanks!


Filter "X has built a Y in Z. (District)" doesn't cover city center

It has the same wording, yet "Your delegate, Abby, has learned that Russia has built a [sic] Ancient Walls in St. Petersburg" was not filtered out like the external district messages have been.

Ah, thanks for finding that! Currently the filters are very rough and somewhat heuristics driven. I'll write in a special case for preventing this bug


Workaround issue 101

Workaround for https://github.com/camptocamp/puppet-postfix/issues/101

Fixed in https://github.com/camptocamp/puppet-postfix/pull/135

Thanks for closing it!

Better late than never! :)


fix for #17

This is something which I could come up with in a couple of hours. The idea is to merge the constituent tuple arguments into a single argument (by joining argument names with τ) and get them unpacked inside the function using array notation.
Let me know your thoughts on the same. Unit tests are still work in progress; will update the PR once they are ready!

 Comment by googlebot
Monday Mar 06, 2017 at 19:35 GMT

Thanks for your pull request.  It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
:memo: Please visit https://cla.developers.google.com/ to sign.
Once you've signed, please reply here (e.g. I signed it!) and we'll verify.  Thanks.

If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address.  Check your existing CLA data and verify that your email is set on your git commits.
If you signed the CLA as a corporation, please let us know the company's name.

 Comment by jamdagni86
Monday Mar 06, 2017 at 19:40 GMT

I signed it!

 Comment by googlebot
Monday Mar 06, 2017 at 19:40 GMT

CLAs look good, thanks!

 Comment by jamdagni86
Wednesday Aug 30, 2017 at 06:38 GMT

@trotterdylan - The build is failing in go 1.9 as mentioned in google/grumpy#378

@jamdagni86: I think we fixed the compilation issues. Please let me know if you think this (#265) is good to merge, in your opinion.


move to rust 2021

I know this is not something we keep an eye on, but what's the MSRV of that change?

Dumb question: MSRV is The "minimum supported Rust version" right?
"increments are a breaking Semver change" policy may applies to this repository 🤔 should it?

The relevant check should update to the minimal dependency versions first, in order to make sure newer compatible versions are ignored in this regard.

AFAIK minimal stable toolchain version with rust edition 2021 is rustc 1.56.0
https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html
This could be propagated in all change logs and maybe include a version bump. But what type? patch, minor or major?

Changing the edition isn't a breaking change because different edition crates can depend on each other. However, this also bumps the required Rust version.
I think we should apply these two changes to this PR:

Bump to 0.45
Add `rust-version = "1.56"

THE version you want to target is 1.56.1 and the last .1 is important.

from Will, this is what srtool is using and is tested.

Not sure how this is important because that is only a security fix and nothing that interacts with compatibility.

rust-version = "1.56.1" introduced
For reference, I tried to get this to cargo build with 1.56.0 and it failed with
error: package `...` cannot be built because it requires rustc 1.56.1 or newer, while the currently active rustc version is 1.56.0

With --ignore-rust-version it does build with 1.56.0, as expected.

For reference, I tried to get this to cargo build with 1.56.0 and it failed with

My post stated "1.56" and not "1.56.0". The fix version is just noise here.

Based on a quick DM, it was decided this PR should be merged :handshake:


retainer's feeling better after what happened at the dome just now.

assigned to XKZ

p happy "Hey Retainer!"
retainer happy "You know, my mood has been stratospheric since you gave me that award for 'Hardest Trier'!"
retainer "You made me realize that I don't need to win some hotshot show to be value and important!"
retainer "That instead of wallowing in my sadness, I should make more of what I do have..."

p "It is no biggie for me!"

assigned to XKZ

i thought you assigned me to do this?


Multiple Inputs

Hi, Any plans to add support for multiple inputs?
For example - Having two images - each will be passed through a different CNN and the final representations of the two will be merged at the end.
Thank you!

We added that some time ago. See the Merge layer: http://keras.io/layers/core/#merge
Note that in concat mode, on GPU, you will have to use the latest version of Theano (get it from the repo, not pip), due a bug with past Theano versions.

Not sure that this is what I wanted: Let say that my input contains two images. I would like one to be passed through CNN1 and the second to be passed through CNN2. Then I can merge them using the merge layer. But how can I use the library in order to handle the two different inputs? Basically I would like to have more than one input or to be able to split the input (using a split layer) to a few layers.. so each sub-input could be passed to a different network...

That's what the Merge layer allows you to do. You can have two different networks, with different inputs (like 2 images) and you can merge their output into a single tensor.

So let say that I want to train such a model.
I have two networks: CNN1 and CNN2.
My training data contain pairs of images: (i1, i2). I want that i1 will be passed through CNN1 and i2 will be passed through CNN2.
How should I design the network and how should I perform the training such that CNN1 will be applied only on i1 and CNN2 will be applied only on i2?
Thank you.

The code snippet example in the doc page I linked provides all the info you need.
You will train your model with list of inputs:
model.fit([X_CNN1, X_CNN2], y)

Which will feed at time t X_CNN1[t] to CNN1 and X_CNN2[t] to CNN2.

Thank you!

I had a similar requirement. What if i need to pass two inputs into the same node. But these two inputs aren't of the same dimension. Say 1 is an image, and the other is some hidden representation of another image in a lower dimension. I cannot concatenate them since they are of different dimensions. Is there any support to access two totally different inputs within a layer. ( i am modifying keras source to add a new node type, LSTM2. But I only have access to one input, i.e. x)

@karishmamalkan I need this feature too. Did you get any update on this?

@jwgu Hi, There was no method to pass multiple inputs to the RNN except to concatenate,dot etc as described by the merge layer. But i found a work around. If you want two inputs, both of which need to be multiplied by trainable weights, then you can use a Graph layer as follows:
Supposed you have two inputs x1 and x2 at each step of the RNN/LSTM. Your RNN function looks like:
h(t) = (Wh * h(t-1)    +    W1 * x1     +  W2 *x2),
then you can have a

Dense layer to perform (W1 * x1 +b1)
Dense layer to perform (W2 * x2 +b2)

Then you can combine these using Merge layer with sum, so you get: (W1 * x1     +  W2 *x2), and then you can pass this sequence into the RNN layer.

Supposedly this Merge Layer should support merging outputs from multiple (>2) sources, right?
I tried concatenating 3 layers, however it failed...
Here is the code for merging:
from keras.layers import Merge

left_branch = Sequential()
left_branch.add(Dense(32, input_dim=784))

middle_branch = Sequential()
middle_branch.add(Dense(32, input_dim=784))

right_branch = Sequential()
right_branch.add(Dense(32, input_dim=784))

merged = Merge([left_branch, middle, right_branch], mode='concat')

final_model = Sequential()
final_model.add(merged)
final_model.add(Dense(10, activation='softmax'))

Here is the code for model fit (of course model compiled before):
final_model.fit([X_left, X_middle, X_right], y)
But I get the following error:
Traceback (most recent call last):
  File "MyCNN_multiple_Img.py", line 170, in <module>
    callbacks=[TensorBoard(log_dir=logpath,histogram_freq=1,write_graph=False)]
  File "/usr/bin/lib/python2.7/site-packages/keras/models.py", line 429, in fit
    sample_weight=sample_weight)
  File "/usr/bin/lib/python2.7/site-packages/keras/engine/training.py", line 1036, in fit
    batch_size=batch_size)
  File "/usr/bin/lib/python2.7/site-packages/keras/engine/training.py", line 963, in _standardize_user_data
    exception_prefix='model input')
  File "/husr/bin/lib/python2.7/site-packages/keras/engine/training.py", line 51, in standardize_input_data
    '...')
Exception: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 2 arrays but instead got the following list of 3 arrays: [array([[[[ 0.49803922,  0.42352942,  0.36862746, ...,  0.68627453,
           0.83529413,  0.85490197],
         [ 0.87843138,  0.98431373,  1.        , ...,  0.4509804 ,
           0.42352942,  0.44...

Is it possible to merge more than two outputs? If so, could some one tell me how should I change my code? Thank you!

It is possible to merge three tensors, basically just the way you describe but without the syntax errors. You are not sharing the code that you are actually using (it wouldn't even run!). The following code runs fine:
from keras.models import Sequential
from keras.layers import Dense, Merge

left_branch = Sequential()
left_branch.add(Dense(32, input_dim=784))

middle_branch = Sequential()
middle_branch.add(Dense(32, input_dim=784))

right_branch = Sequential()
right_branch.add(Dense(32, input_dim=784))

merged = Merge([left_branch, middle_branch, right_branch], mode='concat')

final_model = Sequential()
final_model.add(merged)
final_model.add(Dense(10, activation='softmax'))

print final_model.inputs

Thank you very much @fchollet !
Sorry didn't put my full code on since it's too long...
But now I think I've figured out what the problem was:
Since in my case, both left_branch and middle branch consist of a stack of convolution+padding+max-pooling layers (copied VGG16 architecture), there is a long code for constructing such a sequential model. So, for laziness...I constructed the sequential model for only once, specifically, I did the following:
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D, ZeroPadding2D
model = Sequential()
model.add(ZeroPadding2D((1, 1), input_shape=(3, 224, 224)))

model.add(Convolution2D(64, 3, 3, activation='relu', name='conv1_1'))
model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(64, 3, 3, activation='relu', name='conv1_2'))
model.add(MaxPooling2D((2, 2), strides=(2, 2)))

model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(128, 3, 3, activation='relu', name='conv2_1'))
model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(128, 3, 3, activation='relu', name='conv2_2'))
model.add(MaxPooling2D((2, 2), strides=(2, 2)))

model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(256, 3, 3, activation='relu', name='conv3_1'))
model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(256, 3, 3, activation='relu', name='conv3_2'))
model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(256, 3, 3, activation='relu', name='conv3_3'))
model.add(MaxPooling2D((2, 2), strides=(2, 2)))

model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(512, 3, 3, activation='relu', name='conv4_1'))
model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(512, 3, 3, activation='relu', name='conv4_2'))
model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(512, 3, 3, activation='relu', name='conv4_3'))
model.add(MaxPooling2D((2, 2), strides=(2, 2)))

model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(512, 3, 3, activation='relu', name='conv5_1'))
model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(512, 3, 3, activation='relu', name='conv5_2'))
model.add(ZeroPadding2D((1, 1)))
model.add(Convolution2D(512, 3, 3, activation='relu', name='conv5_3'))
model.add(MaxPooling2D((2, 2), strides=(2, 2)))

Then I say:
left_branch=model
left_branch.add(Flatten(input_shape=model.output_shape[1:]))
left_branch.add(Dense(output_dim=4096, activation='relu'))

middle_branch=left_branch  ## Here is for laziness

right_branch = Sequential()
right_branch.add(Dense(output_dim=400, input_dim=200,activation='linear'))

So far, I thought I've constructed the two branches, with left and middle branching having the same structure. So I merge them
from keras.layers import Merge
merged = Merge([left_branch, middle_branch, right_branch], mode='concat')
final_model = Sequential()
final_model.add(merged)
final_model.add(Dense(output_dim=1, activation='sigmoid'))

Then I compile and train the model:
final_model.compile(loss='mean_squared_error', optimizer='adadelta', metrics=['accuracy'])
from keras.callbacks import TensorBoard
logpath=mypath+'/mylog/log1'
final_model.fit([img_left, img_middle, text_right], y,
          nb_epoch=60, batch_size=20, shuffle=True,
                callbacks=[TensorBoard(log_dir=logpath,histogram_freq=1,write_graph=False)] )

And the following error raised:
Traceback (most recent call last):
  File "MyCNN_multiple_Img.py", line 170, in <module>
    callbacks=[TensorBoard(log_dir=logpath,histogram_freq=1,write_graph=False)]
  File "/usr/bin/lib/python2.7/site-packages/keras/models.py", line 429, in fit
    sample_weight=sample_weight)
  File "/usr/bin/lib/python2.7/site-packages/keras/engine/training.py", line 1036, in fit
    batch_size=batch_size)
  File "/usr/bin/lib/python2.7/site-packages/keras/engine/training.py", line 963, in _standardize_user_data
    exception_prefix='model input')
  File "/husr/bin/lib/python2.7/site-packages/keras/engine/training.py", line 51, in standardize_input_data
    '...')
Exception: Error when checking model input: the list of Numpy arrays that you are passing to your model is not the size the model expected. Expected to see 2 arrays but instead got the following list of 3 arrays: [array([[[[ 0.49803922,  0.42352942,  0.36862746, ...,  0.68627453,
           0.83529413,  0.85490197],
         [ 0.87843138,  0.98431373,  1.        , ...,  0.4509804 ,
           0.42352942,  0.44...

I then printed the input shape of final_model and got:
[(None, 3, 224, 224), (None, 200)]
while I was expecting:
[(None, 3, 224, 224), (None, 3, 224, 224), (None, 200)]

So I assume a safe way of merging multiple sources is to, for each source, go from the very beginning towards the end to construct a sequential model, then merge them (after I did so, the code worked)?
If we have some branches that have the same configuration/structure, is it possible to go through the construction only once, for all those branches? Thanks!

@fchollet regarding your answer
The code snippet example in the doc page I linked provides all the info you need.
You will train your model with list of inputs:
model.fit([X_CNN1, X_CNN2], y)
Which will feed at time t X_CNN1[t] to CNN1 and X_CNN2[t] to CNN2.
Does model.fit accepts multiple inputs for validation data? For example, Is the following line legitimate?
model.fit([X_CNN1, X_CNN2], y, .... , validation_data=([X_CNN1_val, X_CNN2_val], y_val))

@karishmamalkan Thanks for your tip on how to provide two different inputs for an RNN. However in this way, later on, a new set of weights are applied to the merged input by the recurrent class, is that right?
Is it fine to have these extra set of parameters in the network?
Sorry if my question sounds naive, as I am new to Keras and in general, to deep learning.

Hi sorry for hacking into this thread. I currently need to implement a layer that needs two inputs but has it own trainable parameters. For example, a linear-chain CRF layer takes tokens and tags as inputs, but it has its own trainable parameters (emission matrix and transition matrix). In this case, should I write a layer that is inherited from Merge?

Hi benjaminklein,
I need to ask you if you found any answer for your question because I need to do the same thing but I don't know how.

@fchollet @benjaminklein How does the problem of 2 CNNs is solved in Keras 2? @fchollet : The link doesn't contain any code snippet anymore.
@ersinyar @fatemaaa Have you people figured it out already?

Can we merge layers with inputs of different sizes ? For example, I would like to merge two LSTM layers, first layer with input sequence shape (30,2) and the other layer with input sequence shape (15,1). I would then like to merge these two layers and pass the output to a second layer.
Please let me know !

I am trying to add three models on passenger data, below is code. I am getting the following error.
OUTPUT
[<tf.Tensor 'dense_249_input:0' shape=(?, 15) dtype=float32>, <tf.Tensor 'conv1d_50_input:0' shape=(?, 15, 1) dtype=float32>, <tf.Tensor 'lstm_27_input:0' shape=(?, 15, 1) dtype=float32>]
(80, 15)
(80, 15, 1)
(80, 15, 1)
ValueError: Error when checking target: expected dense_258 to have shape (None, 10) but got array with shape (80, 1)
`
import pandas as pd
import math
import numpy as np
from pandas import read_csv
from pandas import datetime
from pandas import Series
from pandas import DataFrame
from keras.models import Sequential
from keras.layers import Dense, Merge
from keras.layers import LSTM, Dropout, SimpleRNN
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_squared_error
from keras.layers import Convolution1D, Conv2D, Dense, Flatten
from keras import optimizers
from keras import losses
from keras.layers.pooling import MaxPooling1D
from keras.layers.convolutional import ZeroPadding1D
convert an array of values into a dataset matrix
def create_dataset(dataset, look_back):
dataX, dataY = [], []
for i in range(len(dataset)-look_back-1):
a = dataset[i:(i+look_back), 0]
dataX.append(a)
dataY.append(dataset[i + look_back, 0])
return numpy.array(dataX), numpy.array(dataY)
fix random seed for reproducibility
numpy.random.seed(7)
load the dataset
dataframe = pd.read_csv('/home/shivampanchal/PycharmProjects/WeatherPrediction/data/pass.csv')
convert into datatime
dataframe['yy_mnh']=pd.to_datetime(dataframe['Month'])
dataframe=dataframe.drop('Month',axis=1)
dataframe=dataframe.sort_values(by=['yy_mnh'])
dataframe=dataframe.drop('yy_mnh',axis=1)
dataset = dataframe.values
dataset = dataset.astype('float32')
normalize the dataset
scaler = MinMaxScaler(feature_range=(0, 1))
dataset = scaler.fit_transform(dataset)
split into train and test sets
train_size = int(len(dataset) * 0.67)
test_size = len(dataset) - train_size
train, test = dataset[0:train_size,:], dataset[train_size:len(dataset),:]
reshape into X=t and Y=t+1
look_back = 15
trainX, trainY = create_dataset(train, look_back)
testX, testY = create_dataset(test, look_back)
#NN
trainX_NN = np.reshape(trainX, (trainX.shape[0], trainX.shape[1]))
testX_NN = np.reshape(testX, (testX.shape[0], testX.shape[1]))
#CNN
trainX_CNN = np.reshape(trainX, (trainX.shape[0], trainX.shape[1], 1))
testX_CNN = np.reshape(testX, (testX.shape[0], testX.shape[1], 1))
#LSTM
trainX_LSTM = numpy.reshape(trainX, (trainX.shape[0], look_back , 1))
testX_LSTM = numpy.reshape(testX, (testX.shape[0], look_back, 1))
batch_size = 5
######################
model1 = Sequential()
model1.add(Dense(10, input_dim=trainX_NN.shape[1], activation='relu'))
model1.add(Dense(8, activation='relu'))
model1.add(Dense(1))
######################
model2 = Sequential()
#model2.add(ZeroPadding1D(padding=1, input_shape=(trainX_CNN.shape[1], 1)))
model2.add(Convolution1D(40, 2, input_shape=(trainX_CNN.shape[1], 1), activation='relu'))
#model2.add(ZeroPadding1D(padding=1))
model2.add(Convolution1D(20, 3,  activation='relu'))
model2.add(Flatten())
model2.add(Dense(10))
model2.add(Dense(5))
model2.add(Dense(1))
######################
model3 = Sequential()
model3.add(LSTM(32, input_shape=(look_back, 1),activation='relu'))
model3.add(Dense(16))
model3.add(Dense(8))
model3.add(Dense(1))
merged = Merge([model1, model2, model3], mode='concat')
final_model = Sequential()
final_model.add(merged)
final_model.add(Dense(10, activation='relu'))
print final_model.inputs
final_model.compile(optimizer='adam',
loss='mean_squared_error')
print(trainX_NN.shape)
print(trainX_CNN.shape)
print(trainX_LSTM.shape)
final_model.fit([trainX_NN, trainX_CNN, trainX_LSTM], trainY,  epochs=10, batch_size=batch_size, verbose=2)
`

This works well.

validation_data=({'daily_input': X_test,
                  'constant_input':X_test_constant},
                 {'classify_output': Y_test})

training_data = ({'daily_input': X_train,
                  'constant_input':X_train_constant},
                 {'classify_output': Y_train})

model.fit(
    {'daily_input': X_train,'constant_input': X_train_constant},
    {'classify_output': Y_train},
    epochs=900,
    batch_size=batch_size,
    verbose = 1,
    validation_data=validation_data,
    class_weight = class_weight)

Probably adding a "data" parameters as an option to define "X" and "y", could make this even more clear and consistent and thus we can use the "training_data " dict as the sole input.

I have two images, first image and its label is good, second images and its label is bad. I want to pass both images at a time to deep learning model for training. While testing I will have two images (unlabelled) and I want to detect which one is good and which one is bad. Could you please tell how to do it?

I built an architecture using merge and tried to fit the model:
`# fine-tune the model
history = model.fit_generator(
[train_generator1, train_generator2],
steps_per_epoch=nb_train_samples//32,
epochs=nb_epoch,
validation_data=[validation_generator1,validation_generator2],
validation_steps = nb_validation_samples//32,
callbacks=[reduce_lr])
`
but got the following error
`---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
 in ()
18     validation_data=[validation_generator1,validation_generator2],
19     validation_steps = nb_validation_samples//32,
---> 20     callbacks=[reduce_lr])
21
22
/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.pyc in wrapper(*args, **kwargs)
89                 warnings.warn('Update your ' + object_name +      90                               ' call to the Keras 2 API: ' + signature, stacklevel=2)
---> 91             return func(*args, **kwargs)
92         wrapper._original_function = func
93         return wrapper
/usr/local/lib/python2.7/dist-packages/keras/models.pyc in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
1254                                         use_multiprocessing=use_multiprocessing,
1255                                         shuffle=shuffle,
-> 1256                                         initial_epoch=initial_epoch)
1257
1258     @interfaces.legacy_generator_methods_support
/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.pyc in wrapper(*args, **kwargs)
89                 warnings.warn('Update your ' + object_name +      90                               ' call to the Keras 2 API: ' + signature, stacklevel=2)
---> 91             return func(*args, **kwargs)
92         wrapper._original_function = func
93         return wrapper
/usr/local/lib/python2.7/dist-packages/keras/engine/training.pyc in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
2114                                          str(validation_data))
2115                     val_x, val_y, val_sample_weights = self._standardize_user_data(
-> 2116                         val_x, val_y, val_sample_weight)
2117                     val_data = val_x + val_y + val_sample_weights
2118                     if self.uses_learning_phase and not isinstance(K.learning_phase(), int):
/usr/local/lib/python2.7/dist-packages/keras/engine/training.pyc in _standardize_user_data(self, x, y, sample_weight, class_weight, check_batch_axis, batch_size)
1424                                     self._feed_input_shapes,
1425                                     check_batch_axis=False,
-> 1426                                     exception_prefix='input')
1427         y = _standardize_input_data(y, self._feed_output_names,
1428                                     output_shapes,
/usr/local/lib/python2.7/dist-packages/keras/engine/training.pyc in _standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
71     else:
72         data = data.values if data.class.name == 'DataFrame' else data
---> 73         data = [np.expand_dims(data, 1)] if data.ndim == 1 else [data]
74
75     if len(data) != len(names):
AttributeError: 'DirectoryIterator' object has no attribute 'ndim'`
anyone please tell me whats wrong ?
@fchollet @benjaminklein @karishmamalkan @jamartinh

Hi, i have similar problem with this issue. i want to merge a thermal and visible image features using deep learning. and i tried to train model u have explained.
model.fit([X_CNN1, X_CNN2], y)
but it shows me the following error:
Traceback*******************
IndexError                                Traceback (most recent call last)
 in ()
----> 1 final_model.fit([train_x1,train_x2],[train_y1,train_y2],steps_per_epoch=20,epochs=10,verbose=1)
c:\users\neehal lingayat\anaconda3\envs\tensorflow1\lib\site-packages\keras\engine\training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
953             sample_weight=sample_weight,
954             class_weight=class_weight,
--> 955             batch_size=batch_size)
956         # Prepare validation data.
957         do_validation = False
c:\users\neehal lingayat\anaconda3\envs\tensorflow1\lib\site-packages\keras\engine\training.py in _standardize_user_data(self, x, y, sample_weight, class_weight, check_array_lengths, batch_size)
790                 feed_output_shapes,
791                 check_batch_axis=False,  # Don't enforce the batch size.
--> 792                 exception_prefix='target')
793
794             # Generate sample-wise weight values given the sample_weight and
c:\users\neehal lingayat\anaconda3\envs\tensorflow1\lib\site-packages\keras\engine\training_utils.py in standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
88         data = data.values if data.class.name == 'DataFrame' else data
89         data = [data]
---> 90     data = [standardize_single_array(x) for x in data]
91
92     if len(data) != len(names):
c:\users\neehal lingayat\anaconda3\envs\tensorflow1\lib\site-packages\keras\engine\training_utils.py in (.0)
88         data = data.values if data.class.name == 'DataFrame' else data
89         data = [data]
---> 90     data = [standardize_single_array(x) for x in data]
91
92     if len(data) != len(names):
c:\users\neehal lingayat\anaconda3\envs\tensorflow1\lib\site-packages\keras\engine\training_utils.py in standardize_single_array(x)
17     elif K.is_tensor(x):
18         shape = K.int_shape(x)
---> 19         if shape is None or shape[0] is None:
20             raise ValueError(
21                 'When feeding symbolic tensors to a model, we expect the'
IndexError: tuple index out of range

my full coded is as follows:
CODE*************************
from keras.layers import Activation
from keras.models import Sequential
from keras.optimizers import SGD,Adam
from keras.layers import Dense, Input,Conv2D,MaxPooling2D,Dropout
from keras.layers.core import Flatten
from keras.optimizers import Adam
from keras.metrics import categorical_crossentropy
import numpy as np
from keras.models import load_model
from keras.datasets import mnist
from keras.models import Model
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import pandas
from pandas import DataFrame
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt

data_path1 = 'C:\tensorflow1\models\research\object_detection\images\csv1.tfrecords'  # address to save the hdf5 file
with tf.Session() as sess:
feature = {'train/image': tf.FixedLenFeature([], tf.string),
'train/label': tf.FixedLenFeature([], tf.int64)}
# Create a list of filenames and pass it to a queue
filename_queue = tf.train.string_input_producer([data_path1], num_epochs=1)
# Define a reader and read the next record
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
# Decode the record read by the reader
features = tf.parse_single_example(serialized_example, features=feature)
# Convert the image data from string back to the numbers
image = tf.decode_raw(features['train/image'], tf.float32)
# Cast label data into int32
label = tf.cast(features['train/label'], tf.int32)
# Reshape image data into the original shape
image = tf.reshape(image, [150, 150, 1])
images, labels = tf.train.shuffle_batch([image, label], batch_size=10, capacity=30, num_threads=1, min_after_dequeue=10)

train_x1=image
train_y1=label

data_path2 = 'C:\tensorflow1\models\research\object_detection\images\csv2.tfrecords'  # address to save the hdf5 file
with tf.Session() as sess:
feature = {'train/image': tf.FixedLenFeature([], tf.string),
'train/label': tf.FixedLenFeature([], tf.int64)}
# Create a list of filenames and pass it to a queue
filename_queue = tf.train.string_input_producer([data_path2], num_epochs=1)
# Define a reader and read the next record
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
# Decode the record read by the reader
features = tf.parse_single_example(serialized_example, features=feature)
# Convert the image data from string back to the numbers
image = tf.decode_raw(features['train/image'], tf.float32)
# Cast label data into int32
label = tf.cast(features['train/label'], tf.int32)
# Reshape image data into the original shape
image = tf.reshape(image, [150,150,1])
images1,labels1 = tf.train.shuffle_batch([image, label], batch_size=10, capacity=30, num_threads=1, min_after_dequeue=10)

train_x2=images1
train_y2=labels1
input1=Input(shape=(150,150,1))
x=Conv2D(32, kernel_size=(3,3), activation='relu',padding='same')(input1)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
x=Conv2D(64, kernel_size=(3,3), activation='relu',padding='same')(x)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
x=Conv2D(128, kernel_size=(3,3), activation='relu',padding='same')(x)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
x=Conv2D(64, kernel_size=(3,3), activation='relu',padding='same')(x)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
x=Conv2D(32, kernel_size=(3,3), activation='relu',padding='same')(x)
x=MaxPooling2D((2,2),padding='same')(x)
branch1=Flatten()(x)
model1=Model(inputs=input1,outputs=branch1)

input2=Input(shape=(150,150,1))
x=Conv2D(32, kernel_size=(3,3), activation='relu',padding='same')(input2)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
x=Conv2D(64, kernel_size=(3,3), activation='relu',padding='same')(x)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
x=Conv2D(128, kernel_size=(3,3), activation='relu',padding='same')(x)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
x=Conv2D(64, kernel_size=(3,3), activation='relu',padding='same')(x)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
x=Conv2D(32, kernel_size=(3,3), activation='relu',padding='same')(x)
x=MaxPooling2D((2,2),padding='same')(x)
x=Dropout(0.25)(x)
branch2=Flatten()(x)
model2=Model(inputs=input2,outputs=branch2)

from keras.layers.merge import concatenate
model_list=[branch1, branch2]
merged = concatenate(model_list,axis=1)
x=Dense(10, activation='relu')(merged)
x=Dense(10, activation='relu')(x)
output= Dense(3, activation='softmax')(x)
final_model=Model(inputs=[input1,input2],outputs=output)

(lr=1e-4, decay=1e-6, momentum=0.9, nesterov=True)
compile the model
Adam = Adam(lr=0.001, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0, amsgrad=False)
final_model.compile(optimizer=Adam, loss='categorical_crossentropy', metrics = ['accuracy'])

train_y2],
final_model.fit([train_x1,train_x2],[train_y1,train_y2],steps_per_epoch=20,epochs=10,verbose=1)

can someone please guide me what i should do .....I am new to this field so i got no idea how to fix this.
thanks in addvance

hi, I have a doubt. In my code,
model.fit(x=[X_train_1,X_train_2],y= Y]
the error is x=ndim is not applicable on a list, how do I rectify this???

@fchollet Hi , I have met a problem. I want to merge two output of different networks with different weights. And the weights are computed by another network. What should I do to finish this? Thank you for your help.

...
# fine-tune the model history = model.fit_generator( [train_generator1, train_generator2], steps_per_epoch=nb_train_samples//32, epochs=nb_epoch, validation_data=[validation_generator1,validation_generator2], validation_steps = nb_validation_samples//32, callbacks=[reduce_lr])
but got the following error
`---------------------------------------------------------------------------
AttributeError Traceback
...

@scstu is it compulsory to use fit_generator method instead of just fit? I thought the current version already make fit scalable. I'm also using images DataIterator built with ImageDataGenerator class, but getting the following error instead
ValueError: Failed to find data adapter that can handle input: (<class 'list'> containing values of types {"<class 'keras_preprocessing.image.directory_iterator.DirectoryIterator'>"}), <class 'NoneType'>

when I tried model.fit( [train_gen1, train_gen2], ... )
Does multiple inputs feature work only with numpy arrays?


inference acceleration support

how much more time will it take for inference acceleation support

You can follow this PR https://github.com/aws/deep-learning-containers/pull/1578