小编Dis*_*ani的帖子

更改 github 中的代码时无法提交更改

我有一个问题,在 github 中编辑脚本时无法提交更改,请有人帮助我

点击查看截图

github

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

cnn IndexError: Target 2 is out of bounds

I got this error after I executed my code and it seems that the below portion of the code is throwing this error. I tried different ways but nothing could solve it. The error is given by the loss function.

for i, data in enumerate(train_loader, 0):


      #  import pdb;pdb.set_trace()
        inputs, labels = data
        print(type(inputs))
        for input in inputs:
            inputs = torch.Tensor(input)
        inputs, labels= Variable(inputs), Variable(labels)
        inputs=inputs.unsqueeze(1)
        optimizer.zero_grad()
        outputs = net(inputs)
        #import pdb;pdb.set_trace()
        loss_size = loss(outputs, labels)
        loss_size.backward()
        optimizer.step()

        running_loss += …
Run Code Online (Sandbox Code Playgroud)

python pytorch

4
推荐指数
1
解决办法
8686
查看次数

从 Pandas 加载图像数据到 pytorch

我是 pytorch 的新手,之前曾在 keras 和 fastai 上工作过。目前正在尝试图像回归任务,挑战是我必须从 Pandas 数据框中加载数据。数据帧结构:

ID   Path   Score
fig1  /folder/fig1.jpg  2
fig2  /folder/fig2.jpg  3
.....
Run Code Online (Sandbox Code Playgroud)

我之前一直致力于将图像直接从文件夹加载到 pytorch,因为这是一项简单的分类任务,但现在有点卡住了。

我查看了 pytorch 论坛,但并没有安静地了解如何实施。任何帮助,将不胜感激。

python pandas deep-learning pytorch

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

转换为 Markdown 为什么在没有 print() 函数的情况下无法正常工作 pandas 1.0

我正在尝试这个例子Converting to Markdown。表格降价没有print()功能不能正确格式化。

>>> df = pd.DataFrame({"A": [1, 2, 3], "B": [1, 2, 3]}, index=['a', 'a', 'b'])
>>> print(df.to_markdown())
|    |   A |   B |
|:---|----:|----:|
| a  |   1 |   1 |
| a  |   2 |   2 |
| b  |   3 |   3 |

>>> df.to_markdown()       # Without print function gave `\n` instead new line
'|    |   A |   B |\n|:---|----:|----:|\n| a  |   1 |   1 |\n| a  |   2 |   2 |\ …
Run Code Online (Sandbox Code Playgroud)

python pandas pandas-1.0

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

标签 统计

python ×3

pandas ×2

pytorch ×2

deep-learning ×1

github ×1

pandas-1.0 ×1