Teams 似乎缺乏将文件镜像到共享目录的任何本机方法。我正在尝试使用 Python(或其他语言,但首选 python!):
A。使用Python直接从微软团队拉入内存并与Pandas一起处理
b. 将团队中的文件复制到共享网络文件夹中(然后 Python 可以读取该文件夹)
我发现了这个,但无法让它与团队一起工作 - 团队 URL 看起来与这些完全不同。如何使用工作或学校帐户在 Python 中读取 SharePoint Online (Office365) Excel 文件?
不过,这似乎很接近我想做的事情。我还在 PyPi 存储库上找到了“pymsteams”。https://pypi.org/project/pymsteams/似乎只是让您向 Teams 发送消息而没有其他功能?除非我误解了什么。
https://pypi.org/project/Office365-REST-Python-Client/
https://pypi.org/project/pymsteams/
from office365.runtime.auth.authentication_context
import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
from office365.sharepoint.file import File
url = 'https://teams.microsoft.com/l/file'
username = 'myusername'
password = 'mypassword'
relative_url ='myurl'
ctx_auth = AuthenticationContext(url)
ctx_auth.acquire_token_for_user(username, password)
Run Code Online (Sandbox Code Playgroud)
尝试运行上面的代码会出现 AttributeError: 'NoneType' object has no attribute 'text'
完整的堆栈跟踪:
runfile('H:/repos/foo/untitled0.py', wdir='H:/repos/foo')
Traceback (most recent call last):
File "<ipython-input-35-314ab7dc63c9>", line 1, in …Run Code Online (Sandbox Code Playgroud) 由于不相关的原因,从 keras --> tensorflow.keras 更新我们的代码库。
keras 2.3.1 张量流 2.1.0
此代码在 keras 上有效,但在 tf.keras 上失败:
weights = applications.VGG16(weights='imagenet', include_top=False).get_weights()
model.set_weights(tempweights)
Run Code Online (Sandbox Code Playgroud)
错误:
You called `set_weights(weights)` on layer "model" with a weight list of length 26, but the layer was expecting 32 weights. Provided weights: [array([[[[ 4.29470569e-01, 1.17273867e-01, 3.40...
Run Code Online (Sandbox Code Playgroud)
使用 keras.applications.VGG16().get_weights() 无法修复它,会导致完全相同的错误。
已经检查了这些看起来相似的 github 问题,但无法找到问题的原因:
https://github.com/keras-team/keras/issues/7229 https://github.com/keras-team/keras/issues/4753
以下作品:
model.weights[0] = weights[0]
Run Code Online (Sandbox Code Playgroud)
看起来 keras.model.set_weights() 有一些处理不匹配权重的行为,但 tf.tensorflow.keras 没有这种行为?
确认的。行为发生了变化。Include_top=True 在我们的具体情况下修复了它,因为这使我们的模型匹配。当模型不匹配时,Keras 不会抛出错误,而且我不确定它在这种情况下到底会做什么。但不会对此进行调查。把解决方案留在这里。