我正在通过本教程使用 tensorboard https://pytorch.org/tutorials/intermediate/tensorboard_tutorial.html#设置 pytorch(v1.3.0 通过 conda)
但在台阶上
from torch.utils.tensorboard import SummaryWriter
# default `log_dir` is "runs" - we'll be more specific here
writer = SummaryWriter('runs/fashion_mnist_experiment_1')
Run Code Online (Sandbox Code Playgroud)
我不断收到错误
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
C:\ProgramData\Anaconda3\envs\fastai_v1\lib\site-packages\torch\utils\tensorboard\__init__.py in
1 try:
----> 2 from tensorboard.summary.writer.record_writer import RecordWriter # noqa F401
3 except ImportError:
ModuleNotFoundError: No module named 'tensorboard.summary'; 'tensorboard' is not a package
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
c:\Users\matt\Documents\code\playground\tensorboard.py in
----> 1 from …Run Code Online (Sandbox Code Playgroud) python data-visualization machine-learning tensorboard pytorch
SQLAlchemy 1.4.17我正在尝试在 pytest 中进行简单的查询
def test_first():
engine = create_engine(settings.SQLALCHEMY_DATABASE_URI)
result = engine.execute(text("SELECT email FROM user"))
Run Code Online (Sandbox Code Playgroud)
但我收到这个错误
Exception has occurred: MissingGreenlet
greenlet_spawn has not been called; can't call await_() here. Was IO attempted in an unexpected place? (Background on this error at: http://sqlalche.me/e/14/xd2s)
File "/Users/mattc/Development/inference/server/inference_server/app/tests/test_01_user.py", line 27, in test_first
result = engine.execute(text("SELECT email FROM user"))
Run Code Online (Sandbox Code Playgroud)
不知道为什么?有什么建议么?
当有人点击网页上的后退按钮时,我在 StateNotifiers 中收到此错误。我已将其隔离到下面请求的地方longRunningAPI。
Exception has occurred.
"Error: Bad state: Tried to use RunListNotifier after `dispose` was called.
Run Code Online (Sandbox Code Playgroud)
我有这样的代码。
final runListController = StateNotifierProvider.autoDispose
.family<RunListNotifier, AsyncValue<List<Run>>, RunListParameter>(
(ref, param) {
return RunListNotifier(read: ref.read, param: param);
});
class RunListNotifier extends StateNotifier<AsyncValue<List<Run>>> {
RunListNotifier({required this.read, required this.param})
: super(AsyncLoading()) {
fetchViaAPI(param);
}
final Reader read;
final RunListParameter param;
void fetchViaAPI(RunListParameter param) async {
state = AsyncLoading();
try {
List<Run> stuff = await read(apiProvider).longRunningAPI(param: param);
state = AsyncData(stuff);
} catch (e) {
state …Run Code Online (Sandbox Code Playgroud) 我想安装 Detectron2,查看本教程 https://detectron2.readthedocs.io/en/latest/tutorials/install.html 但不确定如何将 -f URL 放入 pip requests.txt
我尝试的所有内容都给出了错误,并且我找不到相关文档。
建议?
在Riverpods中,可以嵌套ConsumerWidgets吗?像这样的东西吗?我想这样做是为了将我的 api 分开,但感觉这可能会降低性能?
class Foo1 extends ConsumerWidget {
@override
Widget build(BuildContext context, ScopedReader watch) {
// watch something
return Container(
child: Foo2(),
);
}
}
class Foo2 extends ConsumerWidget {
@override
// watch something
Widget build(BuildContext context, ScopedReader watch) {
return Container();
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个快速的枚举
enum MainState : Int {
case NotStarted
case Init
case AskWhatToText
case RecordWhatToText
}
var state = MainState.NotStarted
Run Code Online (Sandbox Code Playgroud)
并希望做类似的事情
state++
Run Code Online (Sandbox Code Playgroud)
但得到一个错误.建议?
python ×3
flutter ×2
riverpod ×2
pandas ×1
pip ×1
pylint ×1
pytorch ×1
sqlalchemy ×1
swift ×1
tensorboard ×1