小编dev*_*1ce的帖子

无法访问 Cloud Firestore 后端 - React Native Firebase v9

我在 SO 上看到了很多关于这个问题的问题,但没有一个得到解答(或者解决方案不起作用),我不知道为什么。人们不断遇到这个错误,但没有提供解决方案。从过去的几天来看,即使我遇到了这个错误(注意:它似乎在我的物理设备上工作正常(不是在调试时,它只有在我释放它时才工作),但在 android 模拟器上却不起作用,所以我很确定我的互联网工作正常):

Setting a timer for a long period of time, i.e. multiple minutes, is a performance and correctness issue on Android as it keeps the timer module awake, and timers can only be called when the app is in the foreground. See https://github.com/facebook/react-native/issues/12981 for more info.
(Saw setTimeout with duration 3052257ms)
Authorization status: 1

[2022-02-09T07:05:26.500Z]  @firebase/firestore: Firestore (9.6.5): Could not reach Cloud Firestore backend. Backend 
didn't respond within 10 seconds.
This typically indicates that …
Run Code Online (Sandbox Code Playgroud)

javascript firebase react-native google-cloud-firestore react-native-firebase

14
推荐指数
1
解决办法
2万
查看次数

“Seq2SeqModelOutput”对象没有属性“logits”BART 转换器

我正在尝试生成长 PDF 的摘要。所以,我所做的,首先使用pdfminer.six库将我的 pdf 转换为文本。接下来,我使用了此处讨论中提供的 2 个函数。

代码:

bart_tokenizer = BartTokenizer.from_pretrained("facebook/bart-large")
bart_model = BartModel.from_pretrained("facebook/bart-large", return_dict=True)

# generate chunks of text \ sentences <= 1024 tokens
def nest_sentences(document):
  nested = []
  sent = []
  length = 0
  for sentence in nltk.sent_tokenize(document):
    length += len(sentence)
    if length < 1024:
      sent.append(sentence)
    else:
      nested.append(sent)
      sent = [sentence]
      length = len(sentence)

  if sent:
    nested.append(sent)
  return nested

# generate summary on text with <= 1024 tokens
def generate_summary(nested_sentences):
  device = 'cuda'
  summaries …
Run Code Online (Sandbox Code Playgroud)

nlp huggingface-transformers

5
推荐指数
1
解决办法
8394
查看次数

根据国家重新排列车牌字符

我正在做一个车牌/车牌识别项目,我正在完成阶段但有一个小问题,我已经成功识别了字符,请考虑以下示例: 在此处输入图片说明

这是一个输入图像,我得到的预测为 2791 2g rj14

尽你所能,ocr 做得很好,但安排被破坏了(破坏了整个目的)。有时它会以正确的顺序输出,但有时却不会,所以当它没有以正确的顺序输出时,我正在尝试开发一种算法,该算法将预测num_plate字符串作为输入并根据我的国家/地区重新排列它(印度)。

下面是一些图片,它们告诉我们印度号码/车牌的格式。

在此处输入图片说明

此外,我已经收集了所有州,但现在,我只想为 3 个州做:德里 (DL)、哈里亚纳邦 (HR)、北方邦 (UP)。更多信息:https : //en.wikipedia.org/wiki/List_of_Regional_Transport_Office_districts_in_India

total_states_list = [
    'AN','AP','AR','AS','BR','CG','CH','DD','DL','DN','GA','GJ','HR','HP','JH','JK','KA','KL',
    'LD','MH','ML','MN','MP','MZ','NL','OD','PB','PY','RJ','SK','TN','TR','TS','UK','UP','WB'
]

district_codes = {
    'DL': ['1','2','3','4','5','6','7','8','9','10','11','12','13'],
    'HR': [01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
            40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,
            71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99
    ]
}
Run Code Online (Sandbox Code Playgroud)

因此,我一直在尝试,但无法提出一种算法,如果不是,则按所需序列重新排列序列。任何帮助将非常感激。

有关 OCR 的详细信息

使用keras-ocr,我得到输入图像的以下输出: 在此处输入图片说明

[
  ('hrlz',  array([[ 68.343796,  42.088367],
                   [196.68803 ,  26.907867],
                   [203.00832 ,  80.343094],
                   [ 74.66408 ,  95.5236  ]], dtype=float32)), 
  ('c1044', array([[ 50.215836, 113.09602 ],
                   [217.72466 ,  92.58473 ],
                   [224.3968  , 147.07387 ],
                   [ 56.887985, 167.58516 ]], dtype=float32)) …
Run Code Online (Sandbox Code Playgroud)

python algorithm python-3.x

5
推荐指数
0
解决办法
104
查看次数

反应原生 iOS PhaseScriptExecution [CP-User]\Generate\Specs BUILD ERROR

我一直在努力解决这个错误,一周前我换到新机器时就发生了这个错误。下面是我的机器配置 -> node、npm、yarn 等:

\n
node --version -> v16.18.1\nwhich node -> /opt/homebrew/opt/node@16/bin/node\nwhich npm -> /opt/homebrew/opt/node@16/bin/npm\nwhich yarn -> /opt/homebrew/bin/yarn\n
Run Code Online (Sandbox Code Playgroud)\n

我也安装了nvm。发生这种情况是否是由于yarn未指向节点安装位置所致?因为目录不同。

\n

然后我尝试使用卸载纱线npm uninstall -g yarn并使用重新安装它npm install -g yarn并进入我的项目,删除节点模块,重新安装 Pod 以及所有内容,但此错误仍然存​​在。

\n

我经历了这些解决方案,但没有一个真正适合我 -> React Native 中的 PhaseScriptExecution [CP-User] 错误

\n

以下是我收到的构建错误:

\n
/bin/sh -c /Users/username/Library/Developer/Xcode/DerivedData/project-bqzfnxmekpsgkmfaztyrfllaudqg/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00047A70.sh\nNode found at: /opt/homebrew/Cellar/node/19.0.1/bin/node\n\n/Users/username/Desktop/project/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/react_native_pods_utils/script_phases.sh: line 83: /opt/homebrew/Cellar/node/19.0.1/bin/node: No such file or directory\nCommand PhaseScriptExecution failed with a nonzero exit code\n\n** BUILD FAILED **\n\n\nThe following build commands failed:\n    PhaseScriptExecution [CP-User]\\ Generate\\ Specs /Users/username/Library/Developer/Xcode/DerivedData/project-bqzfnxmekpsgkmfaztyrfllaudqg/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E00047A70.sh (in …
Run Code Online (Sandbox Code Playgroud)

node.js npm react-native

2
推荐指数
1
解决办法
2363
查看次数

React Native 导航 v6 身份验证流程

我有一个应用程序,我可以在其中登录/注册并可以注销/注销,我正在使用react navigation v6相同的应用程序,并且我可以登录,但是当我注销时,它不会立即将我注销,我会到hot restart应用程序,然后我已经注销了,它只是在没有热重启的情况下不会注销我,而且,在注销时,我收到错误/警告:

error:

The action 'NAVIGATE' with payload {"name":"Login"} was not handled by any navigator.
Do you have a screen named 'Login'?
If you're trying to navigate to a screen in a nested navigator, see https://reactnavigation.org/docs/nesting-navigators#navigating-to-a-screen-in-a-nested-navigator.
This is a development-only warning and won't be shown in production.
Run Code Online (Sandbox Code Playgroud)

下面是我正在使用的代码:

上下文文件:

The action 'NAVIGATE' with payload {"name":"Login"} was not handled by any navigator.
Do you have a screen named 'Login'?
If you're trying to navigate …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-native react-navigation

0
推荐指数
1
解决办法
7316
查看次数